0

私のアプリケーションでは、ギャラリービューに画像を表示しました。しかし、必要なのは画像とその画像の下のテキストです。ギャラリービューに10枚の画像があると考えてください。各画像の下に、その画像を説明するテキストが必要です(その画像画像に)長さ)次のxmlコードを試しましたが、画像が表示されていないことを示すテキストのみが表示されます

私のxmlファイル:

<?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"
    >

    <ImageView
            android:id="@+id/imageview1"
            android:layout_width="120dp"
            android:layout_height="100dp"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="-20dp"           

            />

             <TextView
            android:id="@+id/text"
            android:layout_width="50dp"
            android:layout_height="wrap_content"   
            android:layout_marginTop="10dp" 
            android:layout_below="@+id/imageview1"


             />         


</RelativeLayout>

私はこのようなデザインが欲しいです:

galleryview1
image1      image2    image3

text1       text2     text3

galleryview2

image1    image2     image3

text1     text2      text3

私を助けてください。

4

1 に答える 1

0
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:orientation = "vertical"
    android:layout_height="fill_parent"
    >

    <ImageView
            android:id="@+id/imageview1"
            android:layout_width="120dp"
            android:layout_height="100dp"
                />

             <TextView
            android:id="@+id/text"
            android:layout_width="50dp"
            android:layout_height="wrap_content"   
            android:layout_marginTop="10dp" 



             />         


</LinearLayout>
于 2012-12-19T09:35:13.603 に答える