Отдельная строка для fill_parent ListView height
В listView есть одна строка, высота которой должна быть такой же, как у listView (скажем, это полноэкранный режим).
Расположение строк выглядит так
<?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="fill_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@drawable/error" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageView"
android:layout_centerHorizontal="true"
android:layout_marginTop="14dp"
android:minHeight="30dip"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</RelativeLayout>
И getView адаптера
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = inflater.inflate(R.layout.myrow, parent, false);
return row;
}
Бу строка отображается так же, как это было бы сandroid:layout_height="wrap_content"
.
Предварительный просмотр макета показывает заполнение строки его родителем, и я используюinflate(R.layout.myrow, parent, false);
, listView, безусловно, отображается в полноэкранном режиме, а длина строки равна изображению + textView.
Я пропускаю что-то важное?