为什么工具栏的启动高度如此之小?但是,如果用户向下滚动,则看起来像是第二个屏幕截图。如您在屏幕截图中所见,它的顶部填充也不正确。这是我的布局xml :
MainActivity
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:fitsSystemWindows="true" >
<android.support.design.widget.CoordinatorLayout
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
android:theme="@style/Theme.Paper.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|enterAlways"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
app:popupTheme="@style/Theme.Paper.PopupOverlay">
<include
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
layout="@layout/toolbar_spinner" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
style="@style/Theme.Paper.FloatingActionButton"/>
</android.support.design.widget.CoordinatorLayout>
<fragment
class="com.test.modal.NavigatorFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
tools:layout="@layout/navigator"
android:fitsSystemWindows="true"/>
</android.support.v4.widget.DrawerLayout>
谁知道我做错了?在FrameLayout
我ViewPager
是否有价值会膨胀。
所以我认为问题出在android:layout_height =“?attr / actionBarSize”
将其更改为android:layout_height =“ match_parent”
然后看看发生了什么!
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句