我正在尝试从TextAppearance
样式读取属性,因此我可以将这些值应用于非平凡的组件(例如TextPaint
)理想情况下,我想接收引用TextAppearance的样式ID,并读取诸如文本颜色,字体等的值。
我注意到R.styleable.TextAppearance
是内部的,因此无法访问,以及TextAppearanceAttributes
类。
这个想法有替代方法吗?
谢谢!
[如果您使用Google Material Components,则它们具有非常有用的TextAppearance
类。它是受限制的API,但您可以忽略它: