В соответствии с принятым ответом на этот вопрос Высота строки GridView , если вы ...
"Установите для LinearLayouts некоторую определенную высоту, и все строки будут всебудь такой высоты. "
Это не похоже на работу в моем случае.У меня есть файл макета для каждой строки следующим образом:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="200dp"
android:layout_gravity="center_horizontal">
<ImageView
android:id="@+id/theimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#ffff0000" />
<TextView
android:id="@+id/thename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
style="?icontext"
android:background="#ff00ff00"/>
</LinearLayout>
И они содержатся в Gridview, определенном так:
<GridView android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:numColumns="auto_fit"
android:columnWidth="100dp"
android:background="@color/background"
android:verticalSpacing="1dp"
android:horizontalSpacing="5dp" />
Это игнорирует 'android: layout_height = "200dp"и вместо этого устанавливает высоту строки для содержимого ячейки.
Что еще хуже, когда мой TextView переносится на вторую строку, эта вторая строка закрывается следующим рядом ячеек.
Чего мне не хватает?