背后CoordinatorLayout AppBarLayout内容 [英] Content behind CoordinatorLayout AppBarLayout
问题描述
我创建我的应用程序设置一个活动/布局。我有一个 CoordinatorLayout
与 AppBarLayout
和工具栏
,然后下面是它包括 content_settings.xml
。当内容加载.xml文件是应用栏的后面。
I was creating a settings activity/layout for my app. I have a CoordinatorLayout
with an AppBarLayout
and Toolbar
, then beneath that it includes content_settings.xml
. When the content loads the .xml file is behind the app bar.
我使用这个相同的设置加载的主要内容,它工作正常,但由于某种原因未设置部分中正确显示。
I'm using this same setup to load the main content and it works fine, but for some reason isn't rendering correctly within the Settings section.
activity_settings.xml
activity_settings.xml
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_setting" />
该content_settings.xml只是一个的FrameLayout
由一个替换 preferenceFragment
The content_settings.xml is just a FrameLayout
that is replaced by a PreferenceFragment
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/settings_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
推荐答案
添加到您的Recyclerview:
add this to your Recyclerview :
app:layout_behavior="@string/appbar_scrolling_view_behavior"
这篇关于背后CoordinatorLayout AppBarLayout内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!