首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TouchListView在拖放后调整视图大小(CommonsWare)

TouchListView在拖放后调整视图大小(CommonsWare)
EN

Stack Overflow用户
提问于 2012-02-09 22:01:37
回答 1查看 227关注 0票数 0

大家好(特别是CommonsWare)

我正在尝试使用TouchListView of CommonsWare。

当我打开应用程序时,列表项的移动是可行的,看起来应该是这样的,但是当我移动这个项目时,视图的大小就不同了(假设大小与simple_list_item_1差不多)。

我的排布:

代码语言:javascript
复制
<?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>

编辑

图片来说明

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-02-10 13:11:53

如果我不得不猜测,您还没有正确地设置normal_height属性到您的TouchListView (或者可能是expanded_height)上。需要将normal_height属性设置为行的高度,这需要是一个固定值。您的行高是基于wrap_content的,不能预先确定。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9219496

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档