この形式で画像と2つのテキストビューと1つのButton.likeを含むリストビューを作成しようとしています
Textview1
image Textview2 Button
上記の形式で、別のレイアウトを作成しました。このレイアウトを listview.for にインフレートしたいと思います。画像の場合、image_1、image_2、image_3、image_4、image_5、image-6 という名前の描画可能なフォルダーに 6 つの画像があるとします。グーグルで見つけた例から理解できません。
<?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="wrap_content">
<ImageView android:src="@drawable/stub"
android:layout_height="50sp" android:layout_width="100sp" android:id="@+id/image"
android:layout_alignParentTop="true" android:layout_alignParentLeft="true"></ImageView>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content" android:text="ADD" android:id="@+id/badd"
android:layout_alignBottom="@+id/textView2"
android:layout_alignParentRight="true" android:layout_marginRight="15dp"></Button>
<TextView android:layout_height="wrap_content" android:id="@+id/tvname" android:textAppearance="?android:attr/textAppearanceMedium" android:layout_width="wrap_content" android:text="TextView" android:layout_alignParentTop="true" android:layout_centerHorizontal="true"></TextView>
<TextView android:layout_height="wrap_content" android:id="@+id/tvprice" android:layout_width="wrap_content" android:text="TextView" android:layout_alignBottom="@+id/image" android:layout_centerHorizontal="true"></TextView>
これを実現するためのAndroidコードを教えてください。