【发布时间】:2018-08-05 02:16:43
【问题描述】:
我的 recyclerview 的项目是动态加载的。底部表单 UI 是一个小型音乐播放器。我想在音乐播放器 UI 上方显示 recyclerview。但目前,音乐播放器 UI 隐藏了 recyclerview 的最后一个元素。音乐播放器的用户界面是动态隐藏/显示的。你能告诉我recyclerview的元素如何在不被底页UI(音乐播放器)阻碍的情况下全部显示吗? 这是我的布局
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="@dimen/detail_backdrop_height"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="@+id/backdrop"
android:layout_width="200dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:fitsSystemWindows="true"
android:scaleType="fitCenter"
android:transitionName="@string/transition_album_cover"
app:layout_collapseMode="parallax" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/my_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<FrameLayout
android:id="@+id/bottom_ui_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_behavior="@string/bottom_sheet_behavior">
<include layout="@layout/music_player_ui" />
</FrameLayout>
</android.support.design.widget.CoordinatorLayout>
【问题讨论】:
-
你有没有尝试交换 FrameLayot 和 RecyclerView
-
我认为这将使音乐播放器落后于recyclerview。这会阻碍音乐播放器用户界面
-
是的,但我以为你想要这样
-
我更新了问题以便更清楚
-
暂时解决了recyclerview的下边距问题
标签: android user-interface android-recyclerview android-coordinatorlayout bottom-sheet