我試圖鋪陳類似於常見的iOS設計的一款Android列表視圖電池 - 在左邊的圖像,以及兩個標籤旁邊的形象: Android - 如何佈置類似於iOS表格視圖單元的列表視圖項目,包含圖像,標題和副標題?
我怎樣才能實現Android手機佈局像基本的iOS單元格,包含圖像,標題和副標題?
但是,我不確定什麼是適當的佈局來完成這項任務。這裏就是我想,它不正確對齊元素:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1">
<TextView
android:id="@+id/api"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.47">
<ImageView
android:layout_width="@dimen/side_button_size"
android:layout_height="@dimen/side_button_size"
android:id="@+id/image"
android:layout_gravity="left|top"
android:background="@drawable/close_red" />
<TextView
android:id="@+id/title"
android:layout_width="246dp"
android:layout_height="82dp"
android:layout_gravity="center_horizontal|top"
android:text="This is title label" />
<TextView
android:id="@+id/subtitle"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_gravity="left|center_vertical"
android:text="This is subtitle label" />
</FrameLayout>
</LinearLayout>
使用本教程來自Vogella:[Custom ListView](http://www.vogella.com/tutorials/AndroidListView/article.html) –