0
この画像のようにする必要があります。グリッドビューを試しましたが、動作しません。同じ行に3つ以上の画像が表示されます。 imageカスタムグリッドビューデザインを作成
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"/>
<TextView
android:id="@+id/textView1"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:text="TextView" />
、これが私のGridViewのです:
<GridView
android:id="@+id/gridview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numColumns="3" > </GridView>
てみました、私もこのGridViewのを持っていました。 –
xmlコードの最初のセットがグリッドアイテムレイアウトであると仮定します。もしそうなら、あなたのtextviewは、imageviewのmatch_parentの高さによって押し出されるので決して見えません。あなたの質問に対する答えではなく、ここで問題を指摘してください。 – Tony
なので、私にいくつかのアイディアを教えてもらえますか?すべての線形レイアウトで3線形レイアウトを使用する必要があります。これを解決するために3つのイメージビューを配置し、グリッドビューを使用せずに、どう思いますか? –