У меня есть следующая компоновка, я хочу установить маржу программно. В этом макете я просматриваю этот макет в baseadpter. Как я могу получить к нему доступ.Как настроить маргинальность в макете, которая существует в другом макете
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<CheckBox
android:layout_width="20dp"
android:layout_height="17dp"
android:button="@drawable/my_custom_checkbox"
android:id="@+id/check"
android:layout_marginTop="5dip"
android:checked="false"
>
</CheckBox>
<RelativeLayout
android:id="@+id/Relative"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:layout_marginRight="6dip"
android:layout_weight="0.5">
<TextView android:id="@+id/list_item_entry_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_marginTop="5dip"
android:layout_marginBottom="15dip"
android:ellipsize="marquee"
android:text="Hello"
android:textAppearance="?android:attr/textAppearanceSmall"
android:fadingEdge="horizontal" />
//Want to access this layout
<LinearLayout
android:id="@+id/LinearCal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="50dip" to 100dip
можем ли мы направить этот макет ?? – UnderGround
java.lang.ClassCastException: android.widget.LinearLayout $ LayoutParams нельзя отбрасывать в android.widget.RelativeLayout $ LayoutParams. Получение этой ошибки. – UnderGround
hmm, извините, мой плохой. Параметры макета должны быть установлены относительно родительского макета .. в вашем случае его относительный макет .. так обновлено сообщение plz check – CRUSADER