Android 如何在坐标布局中排列视图?
我的Android 如何在坐标布局中排列视图?,android,android-xml,android-toolbar,android-collapsingtoolbarlayout,Android,Android Xml,Android Toolbar,Android Collapsingtoolbarlayout,我的可折叠工具栏工作正常,但当我试图使用嵌套滚动视图向上滚动时,它覆盖了标题。我试着把它放在相对布局中,但是工具栏停止工作,不再崩溃 这是我的布局 <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="htt
可折叠工具栏
工作正常,但当我试图使用嵌套滚动视图
向上滚动时,它覆盖了标题。我试着把它放在相对布局中,但是工具栏停止工作,不再崩溃
这是我的布局
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cordinator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff"
tools:context="com.store.android.basic.Introduction">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include
android:id="@+id/introduction_toolbar"
layout="@layout/app_toolbar" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp">
<TextView
android:id = "@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="@string/heading"
android:textColor="#D31F33"
android:textSize="25sp"
android:textStyle="bold" />
<TextView
android:id = "@+id/sub_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/text_one"
android:textSize="18sp" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
app:layout\u behavior=“@string/appbar\u scrolling\u view\u behavior”
只需将这一行放在NestedScrollView中