Android的删除列表视图视图、列表、Android

2023-09-04 06:34:32 作者:此用户被屏蔽

我的ListView含有复选框,并在该复选框被clikced我表明,在执行删除操作,屏幕下方的一个按钮,但图像时的ListView的高度越多,那么列表视图按钮在某些部分的举动,所以我需要一个为删除替代选项谁能帮助我,我只是像菜单?

 < RelativeLayout的
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT>
  <按钮机器人:layout_centerHorizo​​ntal =真
机器人:layout_width =150dp
机器人:layout_height =WRAP_CONTENT
机器人:ID =@ + ID / DelPhto
机器人:文本=删除机器人:layout_alignParentBottom =真/>
  <的ListView
机器人:layout_width =280dp
机器人:layout_height =FILL_PARENT
机器人:ID =@ + ID / list_pictures
机器人:layout_alignParentTop =真
机器人:layout_above =@ + ID / DelPhto/>
  < / RelativeLayout的>
 

解决方案

你的意思是你希望的删除按钮是始终可见,即使列表内容比列表控件大?

如果是这样的情况下,尝试设置你的ListView的layout_weight 1,看看是否能解决你的问题。

android 核心组件 1 常用布局, adapter, handler, UI

I have listview that contain checkbox and an image when the checkbox is clikced I show a button at bottom of the screen that perform deletion, but when listview height more ,then the listview some portion move under the button ,so I need an alternative option for delete can anyone help me, I except something like menu?

<RelativeLayout 
android:layout_width="fill_parent" 
android:layout_height="fill_parent">
  <Button android:layout_centerHorizontal="true" 
android:layout_width="150dp" 
android:layout_height="wrap_content" 
android:id="@+id/DelPhto" 
android:text="Delete" android:layout_alignParentBottom="true" /> 
  <ListView 
android:layout_width="280dp" 
android:layout_height="fill_parent" 
android:id="@+id/list_pictures" 
android:layout_alignParentTop="true" 
android:layout_above="@+id/DelPhto" /> 
  </RelativeLayout>

解决方案

Do you mean you wish for the delete button to be always visible even when the list contents are larger than the list control?

If that's the case try setting the layout_weight of your ListView to 1 and see if that solves your problem.