android – 单击右上角的Floating ActionButton可以点击RecyclerView项目

android – 单击右上角的Floating ActionButton可以点击RecyclerView项目,第1张

概述我想在recyclerview上添加浮动 *** 作按钮,但问题是当我点击浮动 *** 作按钮Recyclerview项目时点击如何删除此问题 见下面的代码 <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".screens.Show 我想在recyclervIEw上添加浮动 *** 作按钮,但问题是当我点击浮动 *** 作按钮RecyclervIEw项目时点击如何删除此问题

见下面的代码

<relativeLayout    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"    tools:context=".screens.ShowSubjectsFrag"    xmlns:androID="http://schemas.androID.com/apk/res/androID"    xmlns:app="http://schemas.androID.com/apk/res-auto"    xmlns:tools="http://schemas.androID.com/tools">    <androID.support.v7.Widget.RecyclerVIEw        androID:ID="@+ID/MainList"        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent"        androID:layout_gravity="center">    </androID.support.v7.Widget.RecyclerVIEw>    <androID.support.design.Widget.floatingActionbutton        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        androID:src="@androID:drawable/ic_input_add"        app:layout_anchor="@ID/MainList"        androID:layout_margin="@dimen/fab_margin"        androID:layout_alignParentBottom="true"        androID:layout_alignParentRight="true"        androID:layout_alignParentEnd="true" /></relativeLayout>
解决方法 在Activity / Fragment中为floatingActionbutton编写VIEw#onClickListener,因为当前您的floatingActionbutton没有为任何事件注册. 有同样的问题 干杯 总结

以上是内存溢出为你收集整理的android – 单击右上角的Floating ActionButton可以点击RecyclerView项目全部内容,希望文章能够帮你解决android – 单击右上角的Floating ActionButton可以点击RecyclerView项目所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1130537.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存