0
在我的layout-sw600dp-land文件夹中,此布局文件用于应用程序启动的主要活动。一旦应用程序启动,两个片段以编程方式添加到相关的框架布局。工具栏被横向推回
此当前布局会导致工具栏被推回到两个框架布局之后。
的viewpager片段和右边的片段占用工具栏空间和工具栏被击退他们俩身后。
<LinearLayout 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:orientation="horizontal" >
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="horizontal" >
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:theme="?attr/ToolBarStyle" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"
android:orientation="horizontal" >
<FrameLayout
android:id="@+id/fragment1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingRight="4dp" />
<FrameLayout
android:id="@+id/fragment2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingRight="4dp" />
</LinearLayout>
<include layout="@layout/nav_drawer_layout" />
</android.support.v4.widget.DrawerLayout>
</LinearLayout>
双窗格(片段)工具栏布局的合适语法是什么?
DrawerLayout可处理2个视图。在你的情况下,你有3个(至少)的意见。 – 2014-12-05 06:17:46
@GabrieleMariotti你会如何建议如何创建我想创建的布局类型? – TheSunny 2014-12-05 17:29:22
@GabrieleMariotti在两个框架布局的顶部添加边距允许工具栏变得可见,有没有更好的解决方案呢? – TheSunny 2014-12-05 18:02:45