Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/219.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android:NestedScrollView中的FrameLayout全屏显示_Android_Material Design - Fatal编程技术网

Android:NestedScrollView中的FrameLayout全屏显示

Android:NestedScrollView中的FrameLayout全屏显示,android,material-design,Android,Material Design,我正在实现可折叠工具栏。我的布局就像 <CoordinatorLayout> <AppBarLayout> <CollapsingToolbarLayout> <ImageView/> <Toolbar/> </CollapsingToolbarLayout> </AppBarLayout> <and

我正在实现可折叠工具栏。我的布局就像

<CoordinatorLayout>

    <AppBarLayout>
        <CollapsingToolbarLayout>
            <ImageView/>
            <Toolbar/>
        </CollapsingToolbarLayout>
    </AppBarLayout>

    <android.support.v4.widget.NestedScrollView 
     android:id="@+id/scroll"
     app:layout_behavior="@string/appbar_scrolling_view_behavior"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:clipToPadding="false"
     android:background="@android:color/white">

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

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

</CoordinatorLayout>
试试这个代码

<android.support.v4.widget.NestedScrollView 
 android:id="@+id/scroll"
 app:layout_behavior="@string/appbar_scrolling_view_behavior"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:clipToPadding="false"
 android:background="@android:color/white">

   <RelativeLayout 
     android:id="@+id/relative_layout"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     >
 <FrameLayout
     android:id="@+id/container_body"
     android:layout_width="match_parent"
     android:layout_height="match_parent" />
   </RelativeLayout>


然后指定FrameLayout的大小

FrameLayout将其子项放置在按照层次堆叠的层中。要执行您想要执行的操作,您应该在位于framelayout内的LinearLayout内膨胀片段。尝试不工作。同样的问题当你说它需要全屏时,这是否意味着你看不到里面有工具栏和Imageview的AppBar?你能把完整的xml代码放在这里吗?什么是
layout\u height
属性
profile\u detail\u include\u layout's
parent?你想在你的碎片里填充什么?它能定高吗?
<android.support.v4.widget.NestedScrollView 
 android:id="@+id/scroll"
 app:layout_behavior="@string/appbar_scrolling_view_behavior"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:clipToPadding="false"
 android:background="@android:color/white">

   <RelativeLayout 
     android:id="@+id/relative_layout"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     >
 <FrameLayout
     android:id="@+id/container_body"
     android:layout_width="match_parent"
     android:layout_height="match_parent" />
   </RelativeLayout>