0
我有这个相当奇怪的问题。我使用默认的Android外观来设计我的TextView
,除了一个接缝外,所有接缝都完美无缺。主题特定的TextView外观并不总是有效
我使用的外观是?android:attr/textAppearanceSmall
,它在更改字体颜色时没有任何问题,当我在布局XML设计器中更改Holo
和Holo.Light
(Android 3.0+)之间的主题时。
但是,一个特定的TextView
在平板电脑上运行时不会被设置样式,而是使用与其他设备完全相同的XML代码。
这里是为TextView
我的XML代码不工作:
<TextView android:id="@+id/textView1"
android:text="TextView"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_width="match_parent"
android:layout_marginTop="2sp"
android:lines="2"
android:gravity="top|center"
android:textAppearance="?android:attr/textAppearanceSmall">
</TextView>
我也尝试使用下面的方法做它的代码,但是,这并不工作,要么:
setTextAppearance(this, android.R.attr.textAppearanceSmall);
有没有想法?
谢谢,这真的很有帮助,并解决了我的问题。我现在正在使用setTextAppearance(这个,android.R.style.TextAppearance_Small来代替。干杯! –
总是乐意帮忙:D –