gpt4 book ai didi

android - 如何在 android 中更改操作栏标题和副标题字体大小?

转载 作者:行者123 更新时间:2023-12-03 22:57:55 24 4
gpt4 key购买 nike

这是我尝试但没有任何 react

<style name="MyCustomTheme" parent="Theme.Freshchat.Light.DarkActionBar">
<item name="titleTextStyle">@style/Style1</item>
</style>

<style name="Style1" parent="@android:style/Widget.TextView">
<item name="android:textSize">12sp</item>
</style>

有关更多上下文,我正在使用 Freshchat 聊天小部件并希望更改标题和副标题字体大小。谢谢!

最佳答案

试试这个你能不能 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:id="@+id/myToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:titleTextAppearance="@style/ToolbarTitleTheme"
app:subtitleTextAppearance="@style/ToolbarSubtitleTheme">
</android.support.v7.widget.Toolbar>

比在 Style.xml 中创建 Style
<style name="ToolbarTitleTheme" parent="@style/TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textSize">20dp</item>
<<item name="android:textColor">#FFAA12</item>
<!-- include other attributes you want to change: textColor, textStyle, etc -->
</style>

<style name="ToolbarSubtitleTheme" parent="@style/TextAppearance.Widget.AppCompat.Toolbar.Subtitle">
<item name="android:textSize">14dp</item>
<item name="android:textColor">#FFAA12</item>
</style>

关于android - 如何在 android 中更改操作栏标题和副标题字体大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47032059/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com