如果我将我的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
?