ListView
異なる行数(いくつかのkey:valueフィールド)を含む可能性のあるアイテムがあります。だから私はLinearLayout
アダプターの中に行を入れて追加しましたgetView
>
次に、リストアイテムの右側の垂直方向の中央に矢印を描画します。
これが私のレイアウトです:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/ListItemContainerBase"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?activatableItemBackground"
android:baselineAligned="true"
android:orientation="horizontal" >
<LinearLayout
android:id="@+id/list_item_middle_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:orientation="vertical" >
</LinearLayout>
<RelativeLayout
android:id="@+id/arrow_container"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_centerHorizontal="true"
android:background="#bbbbbb" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:padding="8dip"
android:src="@drawable/arrow" />
</RelativeLayout>
</RelativeLayout>
今私の問題は次のとおりです。list_item_middle_containerにビューを追加した後、arrow_containerのサイズが変更されません。ImageViewのみをラップしますが、親の高さは塗りつぶしません。requestLayoutを呼び出して、可視性のオン/オフを切り替えようとしましたが、結果がありません。ありがとう!