3

I'm using this: https://xisberto.wordpress.com/2014/11/08/how-to-combine-actionbar-and-preferenceactivity-headers-with-appcompat/

enter image description here enter image description here

The "Settings" font size changes between portrait and landscape. How do I keep it consistent?

tachyonflux
  • 20,103
  • 7
  • 48
  • 67

2 Answers2

2

It is normal, the toolbar height in portrait mode have 56 dp, in landscape 48 dp, the OS resize its height. Take care if you change the title size in landscape because you can put it higher than the toolbar.

JavierSegoviaCordoba
  • 6,531
  • 9
  • 37
  • 51
  • 3
    It looks wrong and does not line up with the action icons/hamburger – behelit Mar 19 '15 at 02:20
  • @behelit thanks to that option, you can do this: http://material-design.storage.googleapis.com/publish/v_2/material_ext_publish/0Bx4BSt6jniD7dHF1bjh0dnZpdlk/style_color_uiapplication_primary2.png – JavierSegoviaCordoba Mar 19 '15 at 02:27
0

Need to override toolbar title text size by adding

app:titleTextAppearance

Toolbar XML:

<android.support.v7.widget.Toolbar
    android:id="@+id/main_toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    app:titleTextAppearance="@style/ToolbarTitle"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

Toolbar Style:

<style name="ToolbarTitle" parent="@style/TextAppearance.Widget.AppCompat.Toolbar.Title">
    <item name="android:textSize">20sp</item>
</style>

Answer taken from here

Community
  • 1
  • 1
Aristo Michael
  • 2,166
  • 3
  • 35
  • 43