
<androID.support.v7.Widget.RecyclerVIEw androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:focusable="true" androID:clickable="true" androID:background="?androID:selectableItemBackground" androID:ID="@+ID/recyclerVIEw" androID:layout_below="@+ID/tool_bar"/>
这是我试图将效果添加到的RecyclerVIEw:
解决方法 我想通了.我唯一要做的就是添加这个属性:androID:background="?androID:attr/selectableItemBackground"
到我的RecyclerVIEw适配器膨胀的布局的根元素:
<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="wrap_content" androID:paddingtop="8dp" androID:paddingBottom="8dp" androID:background="?androID:attr/selectableItemBackground" tools:background="@drawable/bg_gradIEnt"> <TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:textSize="17sp" androID:layout_marginleft="15dp" androID:layout_marginStart="15dp" androID:ID="@+ID/shopPingListItem" androID:hint="@string/enter_item_hint" androID:layout_centerVertical="true" androID:layout_alignParentleft="true" androID:layout_alignParentStart="true"/> <CheckBox androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:text="@string/shopPing_List_item_checkBox_label" androID:ID="@+ID/shopPingListCheckBox" androID:layout_centerVertical="true" androID:layout_marginRight="15dp" androID:layout_alignParentRight="true" androID:layout_alignParentEnd="true" androID:checked="false"/></relativeLayout>
结果:
总结以上是内存溢出为你收集整理的android – 为RecyclerView项添加Ripple效果全部内容,希望文章能够帮你解决android – 为RecyclerView项添加Ripple效果所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)