【发布时间】:2016-11-25 19:19:27
【问题描述】:
如果我将TextView 定义为:
<TextView
style="@android:style/TextAppearance.DeviceDefault.Large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
和做的基本一样:
<TextView
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
我知道style 是某种更广泛的限定符(即不能在android:textAppearance 中设置所有属性),但它提出了一个问题:为什么要麻烦?使用android:textAppearance 比使用style 有什么优势吗?
【问题讨论】:
标签: android textview android-styles