根据杰克沃顿的说法,对于全息设计,建议的动作条高度在景观期间为40dp:https://stackoverflow.com/a/7181591/72437
我想知道,对于材料设计,推荐的工具栏高度是多少?
我在Google设计指南中找不到任何信息:http://www.google.com/design/spec/components/toolbars.html
我之所以这样问,是因为我在横向模式中看起来很不愉快.推荐的解决方案是放大文字大小:Android工具栏:横向模式下的小标题文字
我只是想知道,在横向模式下,我应该只使工具栏高度更小,而不是放大文字大小吗?我倾向于看看GMail应用程序.


谷歌似乎希望在横向过程中拥有更小的文本大小和更小的工具栏高度.那么,景观工具栏的确切高度是多少?
我有一个应用程序(这里),其中有Admob横幅,我不喜欢每次更改方向时都会重新加载横幅的事实,所以很长一段时间我都有相同的解决方法,以避免重新创建活动,因此避免重新创建Admob视图:
<activity ... android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:screenOrientation="fullUser" ...>
Run Code Online (Sandbox Code Playgroud)
这很好用,但它不是一个好的解决方案或推荐.只是因为这个问题我必须使用的解决方法(在这里写了一下).
问题是某些UI元素(例如工具栏)不会根据新方向进行更改.
这会导致工具栏保持与应用程序启动时相同的高度和相同的字体大小的行为.
肖像 - >风景示例:
正如你所看到的,景观的高度保持很大,字体大小也很大.
横向 - >肖像示例:
在这里你看到相反的情况.高度保持很小,字体大小也很小.
布局基本上是这样的:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.drawerlayout.widget.DrawerLayout
android:id="@+id/activity_app_list__drawerLayout" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent" android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary">
<androidx.appcompat.widget.Toolbar
android:id="@+id/activity_main__toolbar" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:background="@null"
android:theme="?attr/actionBarTheme" tools:ignore="UnusedAttribute"/>
</FrameLayout>
<RelativeLayout
android:layout_width="match_parent" android:layout_height="match_parent">
<FrameLayout
android:id="@+id/activity_app_list__fragmentContainer"
android:layout_width="match_parent" android:layout_height="match_parent"
android:layout_above="@+id/activity_app_list__adContainer"/>
<ImageView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:src="@drawable/msl__action_bar_shadow"
tools:ignore="ContentDescription"/>
<FrameLayout
android:id="@+id/activity_app_list__adContainer"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
</LinearLayout>
<ScrollView
android:id="@+id/activity_app_list__drawerView" android:layout_width="240dp"
android:layout_height="match_parent" android:layout_gravity="start"
android:background="?android:attr/windowBackground">
<LinearLayout
android:layout_width="match_parent" android:layout_height="wrap_content" …Run Code Online (Sandbox Code Playgroud) 当我将方向从纵向更改为横向时,工具栏标题的文本大小会减小,而当我更改回纵向时,则会重置为重置。ActionBarActivity使用扩展了发生这种情况的活动getSupportActionBar()。
android toolbar android-actionbar android-5.0-lollipop android-toolbar