阅读文本外观属性

问题描述 投票:1回答:1

我正在尝试从TextAppearance样式读取属性,因此我可以将这些值应用于非平凡的组件(例如TextPaint)理想情况下,我想接收引用TextAppearance的样式ID,并读取诸如文本颜色,字体等的值。

我注意到R.styleable.TextAppearance是内部的,因此无法访问,以及TextAppearanceAttributes类。

这个想法有替代方法吗?

谢谢!

android android-view android-styles
1个回答
0
投票

[如果您使用Google Material Components,则它们具有非常有用的TextAppearance类。它是受限制的API,但您可以忽略它:

© www.soinside.com 2019 - 2024. All rights reserved.