13

如何在styles.xml 中给出粗体和正常样式?我给出的代码是:

<style name="textbold" parent="@android:style/TextAppearance">
    <item name="android:layout_width">wrap_content</item>
    <item name="android:layout_height">wrap_content</item>
    <item name="android:textstyle">bold</item>
</style>
<style name="textregular" parent="@android:style/TextAppearance">
    <item name="android:layout_width">wrap_content</item>
    <item name="android:layout_height">wrap_content</item>
    <item name="android:textstyle">normal</item>
</style>

但它在这里显示错误:<item name="android:textstyle">

4

1 回答 1

24

那是因为它是textStyle,不是textstyle。属性区分大小写。

    <item name="android:textStyle">normal</item>
于 2011-02-10T05:42:13.803 回答