Android AppBarLayout与ConstraintLayout重叠
我有一个Android AppBarLayout与ConstraintLayout重叠,android,Android,我有一个AppBarLayout嵌套在CoordinatorLayout <?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"
AppBarLayout
嵌套在CoordinatorLayout
<?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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.michael.blemanager.Activities.ColorPickerActivity.Color1">
<android.support.design.widget.AppBarLayout
android:id="@+id/appBar"
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_color1"/>
</android.support.design.widget.CoordinatorLayout>
现在由于某种原因,AppBarLayout
与ConstraintLayout
查看工具栏与颜色圆重叠的位置?如何防止重叠
将坐标布局更改为约束布局
我也有同样的问题,这对我很有效 使用
appbar\u scrolling\u view\u behavior
的layout\u behavior
将include标记包装在FrameLayout
中,如下所示:
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<include layout="@layout/content_color1"/>
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<include layout="@layout/content_color1"/>
</FrameLayout>