TouchListView调整后的视图(CommonsWare)

时间:2012-02-09 22:01:38

标签: android commonsware-cwac

大家好(特别是CommonsWare)

我正在尝试使用CommonsWare的TouchListView。

当我打开应用程序时,列表项的移动工作并且看起来应该这样,但是当我移动项目时,视图会有不同的大小(认为大小与simple_list_item_1大致相同)。 / p>

我的行布局:

<?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>

修改

图片说明

illustration

1 个答案:

答案 0 :(得分:1)

如果我不得不猜测,您未在normal_height(或可能TouchListView)上正确设置expanded_height属性。 normal_height属性需要设置为行的高度,这需要是固定值。您的行高基于wrap_content,事先不知道。

相关问题