我已经在我的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