【发布时间】:2016-02-14 22:42:39
【问题描述】:
我在回收者的视图项中使用了涟漪效果,但效果没有扩大 到视图的整个宽度。例如,如果 textview 仅包含几个符号,则涟漪效应适用于此符号宽度,但不适用于所有项目宽度(项目宽度 = match_parent)
这是我的代码:
我的片段
<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:padding="2dp" />
RecyclerView_item
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/item_background">
<TextView
android:id="@+id/item_question"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:textSize="15sp"
android:textStyle="bold" />
</FrameLayout>
item_background.xml
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:colorControlHighlight">
<item android:drawable="@color/colorItem" />
我该如何解决这个问题?
【问题讨论】:
标签: java android xml android-recyclerview ripple