Einzelne Zeile bis zur Höhe von fill_parent ListView
Es gibt eine Zeile in der ListView, die dieselbe Höhe wie die ListView haben soll (sagen wir, das ist Vollbild).
Das Zeilenlayout sieht so aus
<?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>
Und der Adapter getView ist
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = inflater.inflate(R.layout.myrow, parent, false);
return row;
}
Die Zeile wird genauso angezeigt wie beiandroid:layout_height="wrap_content"
.
In der Layoutvorschau wird die Zeile angezeigt, die die übergeordnete Zeile ausfüllt, die ich verwendeinflate(R.layout.myrow, parent, false);
wird die listView sicherlich im Vollbildmodus angezeigt und die Zeile ist nur so groß wie die image + textView.
Vermisse ich etwas Wichtiges?