【问题标题】:NestedScrollView not work with CollapsingToolbar under CoordinatorLayoutNestedScrollView 不适用于 CoordinatorLayout 下的 CollapsingToolbar
【发布时间】:2018-08-27 14:51:17
【问题描述】:

当使用CollapsingToolbar 时,NestedScrollView 的滚动行为出现问题,停止工作,请帮助它看起来内容滚动仅基于 appbar_scrolling_view_behavior,但无法使用 NestedScrollView 滚动内容。一些奇怪的行为是当点击一些EditText,在片段布局和关闭虚拟键盘后,滚动工作应该是!!

库版本

// Sdk and tools
minSdkVersion = 16
targetSdkVersion = 26
compileSdkVersion = 26
buildToolsVersion = '27.0.3'

// App dependencies
supportLibraryVersion = '27.1.0'
constraintLayout = '1.1.0-beta5'

implementation "com.android.support:design:$supportLibraryVersion"
implementation "com.android.support:support-v13:$supportLibraryVersion"
implementation "com.android.support:cardview-v7:$supportLibraryVersion"
implementation "com.android.support:gridlayout-v7:$supportLibraryVersion"
implementation "com.android.support.constraint:constraint-layout:$constraintLayout"
implementation 'com.android.support:multidex:1.0.3'

UserProfileEditActivity

class UserProfileEditActivity : DaggerAppCompatActivity() {

    @Inject
    lateinit var appRepo: AppRepository

    companion object {
        fun createIntent(context: Context): Intent = Intent(context, UserProfileEditActivity::class.java)
                .apply { flags = Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_user_profile_edit)

        supportFragmentManager.findFragmentById(R.id.contentContainer)
                ?: supportFragmentManager.beginTransaction()
                        .add(R.id.contentContainer, UserProfileEditFragment())
                        .commit()

    }
}

布局:activity_user_profile_edit

只是一个重复小部件,用于测试滚动内容。

<?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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

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

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appBarLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/transparent"
        android:theme="@style/ThemeOverlay.AppCompat.Dark"
        app:elevation="0dp">

        <android.support.design.widget.CollapsingToolbarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:contentScrim="?attr/colorPrimary"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <ImageView
                android:id="@+id/imgPeopleCover"
                android:layout_width="match_parent"
                android:layout_height="150dp"
                android:scaleType="centerCrop"
                android:src="@drawable/bg_cover_test"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <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">

                <TextView
                    android:id="@+id/tvToolbarTitle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="40dp"
                    android:gravity="center_vertical"
                    android:text="ลิลลี่ ฮิกซ์"
                    android:textColor="@android:color/white"
                    android:textSize="20sp" />

            </android.support.v7.widget.Toolbar>

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

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

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

布局:fragment_user_profile_edit

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView 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"
    android:fillViewport="true">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/from_edge_space"
            android:layout_marginStart="@dimen/from_edge_space"
            android:layout_marginTop="16dp"
            android:orientation="vertical"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <TextView
                style="@style/TextView.Secondary"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="ชื่อ" />

            <EditText
                style="@style/TextView.Big"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:hint="กรอกชื่อหมุด" />

        </LinearLayout>


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/from_edge_space"
            android:layout_marginStart="@dimen/from_edge_space"
            android:layout_marginTop="16dp"
            android:orientation="vertical"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <TextView
                style="@style/TextView.Secondary"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="ชื่อ" />

            <EditText
                style="@style/TextView.Big"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:hint="กรอกชื่อหมุด" />

        </LinearLayout>


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/from_edge_space"
            android:layout_marginStart="@dimen/from_edge_space"
            android:layout_marginTop="16dp"
            android:orientation="vertical"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <TextView
                style="@style/TextView.Secondary"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="ชื่อ" />

            <EditText
                style="@style/TextView.Big"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:hint="กรอกชื่อหมุด" />

        </LinearLayout>


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/from_edge_space"
            android:layout_marginStart="@dimen/from_edge_space"
            android:layout_marginTop="16dp"
            android:orientation="vertical"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <TextView
                style="@style/TextView.Secondary"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="ชื่อ" />

            <EditText
                style="@style/TextView.Big"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:hint="กรอกชื่อหมุด" />

        </LinearLayout>


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/from_edge_space"
            android:layout_marginStart="@dimen/from_edge_space"
            android:layout_marginTop="16dp"
            android:orientation="vertical"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <TextView
                style="@style/TextView.Secondary"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="ชื่อ" />

            <EditText
                style="@style/TextView.Big"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:hint="กรอกชื่อหมุด" />

        </LinearLayout>

        <LinearLayout
            android:id="@+id/pinNameContainer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/from_edge_space"
            android:layout_marginStart="@dimen/from_edge_space"
            android:layout_marginTop="16dp"
            android:orientation="vertical"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <TextView
                style="@style/TextView.Secondary"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="ชื่อ" />

            <EditText
                android:id="@+id/edtPinName"
                style="@style/TextView.Big"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:hint="กรอกชื่อหมุด" />

        </LinearLayout>

        <LinearLayout
            android:id="@+id/pinDescContainer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/from_edge_space"
            android:layout_marginStart="@dimen/from_edge_space"
            android:layout_marginTop="@dimen/from_edge_space"
            android:orientation="vertical"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/pinNameContainer">

            <TextView
                style="@style/TextView.Secondary"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="นามสกุล" />

            <EditText
                android:id="@+id/edtPinDesc"
                style="@style/TextView.Big"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:hint="กรอกรายละเอียด" />

        </LinearLayout>

        <LinearLayout
            android:id="@+id/genderContainer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/from_edge_space"
            android:layout_marginStart="@dimen/from_edge_space"
            android:layout_marginTop="@dimen/from_edge_space"
            android:orientation="vertical"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/pinDescContainer">

            <TextView
                style="@style/TextView.Secondary"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="เพศ" />

            <EditText
                android:id="@+id/edtGender"
                style="@style/TextView.Big"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:drawableEnd="@drawable/ic_chevron_right"
                android:drawableRight="@drawable/ic_chevron_right"
                android:enabled="false"
                android:hint="ไม่ระบุ" />

        </LinearLayout>

        <LinearLayout
            android:id="@+id/endDateContainer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/from_edge_space"
            android:layout_marginStart="@dimen/from_edge_space"
            android:layout_marginTop="@dimen/from_edge_space"
            android:orientation="vertical"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/genderContainer">

            <TextView
                style="@style/TextView.Secondary"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="วันสิ้นสุด" />

            <TextView
                android:id="@+id/tvEndDate"
                style="@style/TextView.Big"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:drawableEnd="@drawable/ic_chevron_right"
                android:drawableRight="@drawable/ic_chevron_right"
                android:text="ไม่ระบุ" />

        </LinearLayout>

        <LinearLayout
            android:id="@+id/privacyContainer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/from_edge_space"
            android:layout_marginStart="@dimen/from_edge_space"
            android:layout_marginTop="@dimen/from_edge_space"
            android:orientation="vertical"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/endDateContainer">

            <TextView
                style="@style/TextView.Secondary"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="ผู้เห็นหมุด " />

            <TextView
                android:id="@+id/tvPrivacy"
                style="@style/TextView.Big"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:drawableEnd="@drawable/ic_chevron_right"
                android:drawableRight="@drawable/ic_chevron_right"
                android:text="สาธารณะ(คนทั่วไปเห็น)" />

        </LinearLayout>


    </LinearLayout>

</android.support.v4.widget.NestedScrollView>

【问题讨论】:

    标签: android android-layout android-coordinatorlayout android-nestedscrollview android-collapsingtoolbarlayout


    【解决方案1】:

    试试这个添加app:layout_behavior="@string/appbar_scrolling_view_behavior"到你的NestedScrollView

    使用这个

    <android.support.v4.widget.NestedScrollView 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"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        android:fillViewport="true">
    

    不是这个

    <android.support.v4.widget.NestedScrollView 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"
        android:fillViewport="true">
    

    EDIT 从您的 FrameLayout 中删除 app:layout_behavior="@string/appbar_scrolling_view_behavior"

    <FrameLayout
            android:id="@+id/contentContainer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
    

    编辑 2

    使用ViewPager

    <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/htab_maincontent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true">
    
    
        <android.support.design.widget.AppBarLayout
            android:id="@+id/htab_appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#2fff00"
            android:fitsSystemWindows="true"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
    
            <android.support.design.widget.CollapsingToolbarLayout
                android:id="@+id/htab_collapse_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"
                app:titleEnabled="false">
    
    
                <android.support.v7.widget.Toolbar
                    android:id="@+id/htab_toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    android:background="@android:color/transparent"
                    app:contentInsetStart="0dp"
                    app:layout_collapseMode="pin"
                    app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
    
                <ImageView
                    android:id="@+id/htab_header"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/ic_launcher_background"
                    app:layout_collapseMode="parallax" />
    
    
            </android.support.design.widget.CollapsingToolbarLayout>
    
            <android.support.design.widget.TabLayout
                android:id="@+id/htab_tabs"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                app:layout_anchor="@+id/MyAppbar"
                app:layout_anchorGravity="bottom"
                app:tabGravity="fill"
                app:tabIndicatorColor="#F21757"
                app:tabMode="scrollable"
                app:tabSelectedTextColor="#F21757"
                app:tabTextColor="@android:color/white" />
    
    
        </android.support.design.widget.AppBarLayout>
    
        <android.support.v4.view.ViewPager
            android:id="@+id/viewpager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />
    
    </android.support.design.widget.CoordinatorLayout>
    

    片段布局

    <?xml version="1.0" encoding="utf-8"?>
    <android.support.v4.widget.NestedScrollView 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"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        android:fillViewport="true">
    
    
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
    
    
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
    
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
    
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
            <TextView
                android:layout_width="match_parent"
                android:padding="10dp"
                android:text="NIELSH"
                android:layout_height="wrap_content" />
    
        </LinearLayout>
    </android.support.v4.widget.NestedScrollView>
    

    【讨论】:

    • @JongzPuangput 很乐意为您提供帮助
    • 非常感谢。
    • 对不起,它仍然无法正常工作,如果我们从 FrameLayout 中删除 app:layout_behavior,此布局将不会位于 appbar 下方
    • 对于测试用例尝试将其添加到应用程序布局下方
    猜你喜欢
    • 1970-01-01
    • 2015-10-22
    • 2019-09-17
    • 2016-03-17
    • 2021-03-10
    • 1970-01-01
    • 1970-01-01
    • 2015-09-25
    • 2021-04-21
    相关资源
    最近更新 更多