Android 如何将RecylerView与片段布局重叠并使其可单击
我有一个包含RecyclerView中单词列表的活动。通过点击“播放”菜单按钮,用户启动播放器,该播放器可以播放列表中的所有单词,并像简单的音乐播放器一样进行操作。玩家是由碎片制成的。目前我自己的活动。在这里,我有两个无法解决的问题:1)片段没有正确地重叠recyclerView。2) 片段按钮不可单击。当我尝试与玩家互动时,第一个列表的项目会不断被点击 为了实现重叠和可点击性,我尝试使用android:alpha和可聚焦属性,但没有带来任何效果。片段的click侦听器的代码已经编写。下面我将发布必要的活动的xml和java代码Android 如何将RecylerView与片段布局重叠并使其可单击,android,android-fragments,android-recyclerview,fragmentmanager,Android,Android Fragments,Android Recyclerview,Fragmentmanager,我有一个包含RecyclerView中单词列表的活动。通过点击“播放”菜单按钮,用户启动播放器,该播放器可以播放列表中的所有单词,并像简单的音乐播放器一样进行操作。玩家是由碎片制成的。目前我自己的活动。在这里,我有两个无法解决的问题:1)片段没有正确地重叠recyclerView。2) 片段按钮不可单击。当我尝试与玩家互动时,第一个列表的项目会不断被点击 为了实现重叠和可点击性,我尝试使用android:alpha和可聚焦属性,但没有带来任何效果。片段的click侦听器的代码已经编写。下面我将发
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/toolbar_words"
layout="@layout/layout_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!--Container for PlayerFragment-->
<FrameLayout
android:id="@+id/player_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" />
<android.support.v7.widget.RecyclerView
android:id="@+id/words_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
请尝试以下代码获取Recyclerview
<android.support.v7.widget.RecyclerView
android:id="@+id/words_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/player_container"/>
为什么不将其放在垂直线性布局中?大卫,我看不出你需要什么亲戚。是的,你是赖特。我不够专心,以至于用简单的线性布局就能达到想要的效果。请将您的评论作为我可以应用的答案
<android.support.v7.widget.RecyclerView
android:id="@+id/words_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/player_container"/>