我发现在一些演示代码中有两种情况,有什么区别?
android:attr / textAppearanceMedium和?android:textAppearanceMedium?谢谢!
情况1
<resources> <style name="myTextAppearance"> <item name="android:textAppearance">?android:attr/textAppearanceMedium</item> </style>
案例2
<resources> <style name="myTextAppearance"> <item name="android:textAppearance">?android:textAppearanceMedium</item> </style> </resources>
解决方法
根据
Android Developer API Guide – Accessing Resources – Referencing style attributes,如果系统资源工具可以找出正确的资源类型,则资源类型是可选的.所以他们指的是相同的价值.