2017-09-06 138 views
0
android:textAppearance="@android:style/TextAppearance.Small" 
android:textAppearance="?android:textAppearanceSmall" 

两者都给出了相同的结果。编译效率有没有差异?这两种语法有什么区别?

+0

[(?)问号Android版XML属性(可能的重复https://stackoverflow.com/questions/2733907/question-mark-in-xml-attributes-for-android ) – alijandro

+0

1st是内置android lib的主题参考,第二个是属性值 –

回答

1
android:textAppearance="@android:style/TextAppearance.Small" 

是文本样式设置直接。

android:textAppearance="?android:textAppearanceSmall" 

是在此Activity或此TextView的主题上设置值的引用文本样式。就像这样:

<style name="MyStyle"> 
<item name="textAppearanceSmall">@style/textStyle</item> 
</style>