简体   繁体   English

NestedScrollView内容未显示在CoordinatorLayout内

[英]NestedScrollView content not displaying inside CoordinatorLayout

I have some content inside of a NestedScrollView that is not showing up. 我在NestedScrollView中有一些内容没有显示出来。 The only things that do display are the contents of the AppBarLayout . 唯一可以显示的是AppBarLayout的内容。 However, when I replace the NestedScrollView with a fragment containing a RecyclerView , it displays as expected. 但是,当我用包含RecyclerView的片段替换NestedScrollView时,它会按预期显示。 I can't seem to figure out what I'm doing wrong here. 我似乎无法弄清楚我在这里做错了什么。

EDIT: I just tested that if I remove the AppBarLayout entirely and also the app:layout_behavior="@string/appbar_scrolling_view_behavior" property on the NestedScrollView , the Preview pane in Android Studio does display my scrolling content. 编辑:我只是测试,如果我删除AppBarLayout完全,也是app:layout_behavior="@string/appbar_scrolling_view_behavior"属性的NestedScrollView ,Android Studio中预览窗格中显示不滚动我的内容。

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

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

    <android.support.design.widget.CollapsingToolbarLayout
        android:id="@+id/collapsing_toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true"
        app:layout_scrollFlags="scroll|exitUntilCollapsed">

        <!-- Extended toolbar -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:minHeight="?attr/actionBarSize"
            app:layout_collapseMode="pin">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"/>

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="72dp">

                <EditText
                    android:id="@+id/name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textCapSentences|textMultiLine"
                    android:hint="Name"/>

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

        </LinearLayout>

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

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

<android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">

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

        <!-- Scrolling content here -->

    </LinearLayout>

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

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

尝试将以下行添加到NestedScrollView:

android:fillViewport="true"

You can use compile 'com.android.support:design:22.2.1' 你可以使用编译'com.android.support:design:22.2.1'

Update to v22.2.1, this is fixed. 更新到v22.2.1,这是固定的。

https://code.google.com/p/android/issues/detail?id=180811 https://code.google.com/p/android/issues/detail?id=180811

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 NestedScrollView没有显示在CoordinatorLayout内部 - NestedScrollView not showing inside CoordinatorLayout CoordinatorLayout内NestedScrollView内的webview不竞争显示内容 - webview inside NestedScrollView inside CoordinatorLayout do not show content competely Android Kotlin NestedScrollView无法在CoordinatorLayout中滚动整个内容 - Android kotlin NestedScrollView not scrolling whole content inside CoordinatorLayout CoordinatorLayout内NestedScrollView内的RecyclerView - RecyclerView inside NestedScrollView inside CoordinatorLayout NestedScrollView 不在 CoordinatorLayout 内滚动 - Android - NestedScrollView not scrolling inside CoordinatorLayout - Android 具有CoordinatorLayout的NestedScrollView内的回收者视图 - Recycler view Inside NestedScrollView with CoordinatorLayout 在CoordinatorLayout内部使用NestedScrollView,RecyclerView(水平)进行NestedScrolling - NestedScrolling with NestedScrollView, RecyclerView (Horizontal), inside a CoordinatorLayout NestedScrollview在CoordinatorLayout的Cardview内部具有EditText不会填充视口 - NestedScrollview with an EditText inside Cardview inside CoordinatorLayout doesn't fill viewport Android - 在Fragment中使用NestedScrollView时,FrameLayout与CoordinatorLayout重叠 - Android - FrameLayout is overlapped by CoordinatorLayout when use NestedScrollView inside the Fragment 滚动时CoordinatorLayout内部的NestedScrollView的波浪效果不起作用 - Wave effect of NestedScrollView inside CoordinatorLayout is not working when scrolling
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM