【发布时间】:2014-10-29 16:15:56
【问题描述】:
所以我的 XML 是这样的:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_height="56dp"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary" />
<FrameLayout
android:id="@+id/main_frag"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- ListView here -->
</android.support.v4.widget.DrawerLayout>
发生了什么事,即使我将我的高度明确设置为 56dp,toolbar 的行为就像match_parent 并且会占据屏幕的整个高度?有更好的方法吗?
或者我应该将工具栏放在我的FragementTransactions 填充FrameLayout 的布局旁边吗?这似乎效率不高,因为我有几个。
【问题讨论】:
标签: android android-xml toolbar android-appcompat