工具栏奇怪的高度

时间:2015-05-19 03:15:31

标签: android material-design android-toolbar

如果您设置

应用程序样式:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">

风格:

<style name="AppTheme.Toolbar.ThemeOverlay" parent="Base.ThemeOverlay.AppCompat.Dark.ActionBar">
        <item name="android:textColorPrimary">@color/pickup_primary_text</item>
        <item name="colorControlHighlight">@color/pickup_accent</item>
        <item name="android:actionMenuTextColor">@color/pickup_primary_text</item>
        <item name="android:textColorSecondary">@color/pickup_primary_text</item>
        <item name="android:background">@color/pickup_primary</item>
        <item name="popupTheme">@style/ThemeOverlay.AppCompat.Light</item>
        <item name="android:elevation">4dp</item>
    </style>

工具栏:

<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:toolbar="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minHeight="?actionBarSize"
    android:theme="@style/AppTheme.Toolbar.ThemeOverlay"
    toolbar:titleTextAppearance="@style/AppTheme.Toolbar.TitleText" />

enter image description here

但是如果我直接在工具栏中设置它

<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:toolbar="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:elevation="4dp"
    android:minHeight="?actionBarSize"
    android:theme="@style/AppTheme.Toolbar.ThemeOverlay"
    toolbar:titleTextAppearance="@style/AppTheme.Toolbar.TitleText" />

enter image description here

我认为这是bug,但他们说不是。

为什么?

0 个答案:

没有答案