我已經在我的MainActivity創建一個列表視圖的自定義ListView和另一個佈局文件:實現該行佈局,看起來像這樣在Android的
的問題是,我該如何實現呢?我在哪裏設置所有必須進入文字的字符串?哪裏去注意?
我在互聯網上看過,但我可以找到一個與我的類似listView的人。
我知道對於字符串我可以使用數組,但我可以設置一個ImageViews數組嗎?
我會很感激,如果你能提供給我的,你給我解釋一下如何「把東西放在」我的ListView裏面詳細的解答
編輯:添加row.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="text"
android:textAllCaps="true"
android:textSize="36sp"
android:layout_marginTop="10dp"
android:fontFamily="sans-serif-condensed"
android:textStyle="bold"
android:textColor="@color/black" />
<TextView
android:id="@+id/note"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/text"
android:text="note note note"
android:layout_marginTop="2dp"
android:fontFamily="sans_serif_medium"
android:textSize="24sp"/>
<ImageView
android:layout_width="200dp"
android:layout_height="140dp"
android:scaleType="fitCenter"
android:layout_alignParentEnd="true"/>
</RelativeLayout>
你有沒有使用過的ListView或GridView的getview? –
@janki不,這是我第一次使用listView – Daniele
閱讀本文[教程](http://www.vogella.com/tutorials/AndroidListView/article.html) – user3502626