Android工具栏minHeight多余?

Flo*_*her 5 xml android toolbar

我在大多数情况下构建了我的工具栏,minHeight设置为actionBarSize:

<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/colorPrimary"
android:minHeight="?actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
</android.support.v7.widget.Toolbar>
Run Code Online (Sandbox Code Playgroud)

但是,如果我删除此属性,则根本没有区别.actionBarSize即使我删除菜单并将应用程序名称设置为空String,工具栏也会保留,因此工具栏中根本没有显示任何内容.

这里有什么我想念的吗?

Man*_*ddy 1

这完全是故意的行为,默认情况下,最小高度ToolBar设置为操作栏高度。所以是的android:minHeight="?actionBarSize"是多余的。我找不到任何关于此的官方文件,但请查看此推文。

https://twitter.com/cyrillottier/status/814465544279691266