0

こんにちは(特にCommonsWare)

CommonsWare の TouchListView を使用しようとしています。

リスト アイテムの移動は機能し、アプリを開いたときに機能するように見えますが、アイテムを移動すると、ビューのサイズが異なります (サイズは simple_list_item_1 とほぼ同じだと思います)。

私の行のレイアウト:

<?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"
                android:gravity="center_vertical"
                android:ignoreGravity="@+id/icon">
   <ImageView android:id="@+id/icon"
              android:layout_alignParentLeft="true"
              android:layout_alignParentTop="true"
              android:layout_alignParentBottom="true"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:src="@drawable/grabber"/>
   <TextView
         android:id="@+id/label"
         android:layout_width="fill_parent"
         android:paddingLeft="9dip"
         android:layout_height="wrap_content"
         android:layout_alignWithParentIfMissing="true"
         android:layout_toRightOf="@id/icon"
         android:layout_centerVertical="true"
         android:textSize="25dip"
         android:ellipsize="marquee"
         android:singleLine="true"/>
   <View
         android:id="@+id/groceryCheckedView"
         android:layout_centerVertical="true"
         android:visibility="gone"
         android:focusable="true"
         android:background="@color/black"
         android:layout_height="2dp"
         android:layout_width="fill_parent"/>
   <View
         android:id="@+id/grocerySeparatorView"
         android:background="@color/red"
         android:layout_height="1dp"
         android:layout_width="fill_parent"
         android:layout_alignParentBottom="true"/>
</RelativeLayout>

編集

説明する写真

図

4

1 に答える 1

1

私が推測しなければならなかった場合、あなたはあなたの(またはおそらく)normal_heightに属性を適切に設定していません。属性は行の高さに設定する必要があり、これは固定値である必要があります。行の高さは に基づいており、事前に知ることはできません。TouchListViewexpanded_heightnormal_heightwrap_content

于 2012-02-10T13:11:53.480 に答える