在协调器布局中使用工具栏时大多数时间都会卡住

时间:2015-07-29 06:52:01

标签: android android-fragments material-design android-coordinatorlayout coordinator-layout

我在FrameLayout中膨胀片段,片段的根布局为NestedScrollView。在向上和向下滚动时,我的工具栏会卡住并且不会返回,或者有时它不会滚动。任何解决方案???

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
    android:id="@+id/drawer_layout"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white">

    <android.support.design.widget.CoordinatorLayout
        android:id="@+id/main_content"
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent">


        <FrameLayout
            android:id="@+id/container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

        <android.support.design.widget.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">


            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?actionBarSize"
                android:background="@android:color/white"
                app:layout_scrollFlags="scroll|enterAlways"/>

            <View
                android:layout_width="fill_parent"
                android:background="@android:color/white"
                android:layout_height="1dp"/>

        </android.support.design.widget.AppBarLayout>

    </android.support.design.widget.CoordinatorLayout>


    <LinearLayout
        android:id="@+id/main_lin_login"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="#111"
        android:orientation="vertical">

        <FrameLayout
            android:id="@+id/main_left_dwrawer_content"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"></FrameLayout>

    </LinearLayout>

    <ListView
        android:id="@+id/right_drawer"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="end"
        android:background="#111"
        android:choiceMode="singleChoice"
        android:divider="@android:color/transparent"
        android:dividerHeight="0dp"/>
</android.support.v4.widget.DrawerLayout>

0 个答案:

没有答案