【发布时间】:2014-12-28 08:10:41
【问题描述】:
使用 Android 5 的新工具栏,图标似乎被截断了! 我正在使用抽屉式导航和新工具栏。有什么建议吗?
它似乎在工具栏的上方
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="30dp"
android:background="?attr/colorPrimary">
</android.support.v7.widget.Toolbar>
这里是抽屉布局
<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:fitsSystemWindows="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<include layout="@layout/toolbar"/>
<!-- The main content view -->
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
<!-- The navigation drawer -->
<ListView android:id="@+id/left_drawer"
android:fitsSystemWindows="true"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@color/gray_light_divider_list_drawerNav"
android:dividerHeight="1dp"
android:background="@color/gray_light_background_list_drawerNav"
/>
编辑:在工具栏中添加这两个属性 android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize"
看起来太大了
【问题讨论】:
标签: android android-5.0-lollipop