android - 覆盖 ?android :attr/textAppearanceSmall 的字体大小

标签 android android-theme

我在我的应用程序中非常频繁地使用 ?android:attr/textAppearanceSmall?android:attr/textAppearanceMedium 。我知道 ?android:attr/textAppearanceSmall 默认为 font-size 14sp?android:attr/textAppearanceMedium默认为font-size 18sp

现在,我们的测试团队希望 ?android:attr/textAppearanceSmallfont-size16sp。有没有办法,我们可以覆盖这些值,这样我就不必逐屏逐行访问来替换它们。

最佳答案

如果有人正在处理类似的问题,我刚刚找到了答案。

我在我的AppTheme中添加了以下行

<item name="android:textAppearanceSmall">@style/AppTheme.TextAppearance.Small</item>

然后我创建了一个新的样式,例如

<style name="AppTheme.TextAppearance.Small" parent="TextAppearance.AppCompat.Small">
    <item name="android:textSize">16sp</item>
</style>

谢谢

关于android - 覆盖 ?android :attr/textAppearanceSmall 的字体大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47465500/

相关文章:

android - mpandroidchart x轴值重复

android - 关于单页应用程序与多页应用程序的内存问题

android - ActionBarSherlock 不支持浅色主题提醒对话框?

android - 删除 App Logo 旁边的空白区域(ActionBar Sherlock)

java - 配置 SAX 解析器

android - 下载文件时出现 InputStream 异常

android - 如何创建一个透明的按钮?

android - 使用手机壁纸作为应用程序背景 - Theme.Wallpaper like behavior

android - appcompat v22.1 小部件着色不显示 5.0 之前的版本

android - 将 Holo 主题与 AppCompatActivity 结合使用