Reputation: 845
Hi all (especially CommonsWare)
I am trying to use the TouchListView of CommonsWare.
The movement of the list items works and looks like it should do when i open the app, but as I move the item around, the views get a different size (Think the size is about the same as the simple_list_item_1).
My row layout:
<?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>
EDIT
Pictures to illustrate
Upvotes: 0
Views: 237
Reputation: 1007534
If I had to guess, you have not properly set the normal_height
attribute on your TouchListView
(or possibly expanded_height
). The normal_height
attribute needs to be set to the height of your rows, which needs to be a fixed value. Your row height is based on wrap_content
, not knowable in advance.
Upvotes: 1