我想改变 Toolbar
中文字的大小。因为在我的应用程序中,Toolbar
文本在横向和纵向模式下都有不同的大小。
Toolbar
中文字的文字大小可以改变吗?
最佳答案
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
android:id="@+id/toolbar"
app:titleTextAppearance="@style/Toolbar.TitleText" />
并以自定义样式覆盖默认标题大小:
<style name="Toolbar.TitleText" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textSize">18sp</item>
</style>
结果:
关于android - 如何更改工具栏文字大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28487312/