如果我定義我TextView
爲:TextView的風格和android:textAppearance屬性有什麼區別?
<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
有什麼優勢?