У меня есть макет XML для представления, представляющего один элемент, отображаемый ExpandableListAdapter. (XML, который дублируется один раз для каждого элемента списка, а не основного макета действия). Сначала я попробовал LinearLayout, но он скрыл последний из трех виджетов (кнопку с изображением). Я понимаю, почему это не работает, но затем я попробовал RelativeLayout, но текстовое представление не отображается.
Сначала я покажу относительный макет вместе со снимком экрана, а также добавлю свой первоначальный макет и снимок экрана внизу FWIW. Спасибо за любую помощь.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="55dip"
android:orientation="horizontal" >
<CheckBox
android:id="@+id/chkParent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:checked="false"/>
<EditText
android:id="@+id/edtParent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/chkParent"
android:textSize="17dip"
android:inputType="text"
android:hint="@string/strItem"/>
<ImageButton
android:id="@+id/btnExpand"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentRight="true"
android:layout_toLeftOf="@id/edtParent"
android:src="@drawable/dark_expand"
android:clickable="true"
android:hint="@string/strViewSubItems"
android:contentDescription="@string/strViewSubItems"
android:background="@null"/>
</RelativeLayout>
Оригинальная линейная планировка:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="55dip"
android:orientation="horizontal" >
<CheckBox
android:id="@+id/chkParent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"/>
<EditText
android:id="@+id/edtParent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="17dip"
android:inputType="text"
android:hint="@string/strItem"/>
<ImageButton
android:id="@+id/btnExpand"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/dark_expand"
android:clickable="true"
android:hint="@string/strViewSubItems"
android:contentDescription="@string/strViewSubItems"
android:background="@null"/>
</LinearLayout>