繁体   English   中英

Android-右侧屏幕按钮

[英]Android - right side screen button

我想问你是否可以在另一个视图上方“放置”按钮。 我想要实现的是一个带有ListView和一个圆形Button的活动,它是从屏幕右侧“出现”的。 但是,如果有人向下滚动,则按钮必须保持在其位置,一旦按下该按钮,就会调用新的片段。 实际上,我一开始就被困住了,不知道该怎么做,因此欢迎您提出任何建议/提示/建议。

PS:应使用按钮将新项目添加到ListView

另外,我还创建了一个草图以进行更好的解释。

感谢和问候

在此处输入图片说明

我为您尝试过,效果很好。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF" >

<ListView
    android:id="@+id/listAlertItems"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:dividerHeight="1px"
    android:listSelector="@android:color/transparent" />

<ImageView
    android:id="@+id/clickBtn"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_centerInParent="true"
    android:src="@drawable/ic_img" />

结果是:

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM