2011-02-10 56 views
11

如何在我們的styles.xml中提供粗體和正常樣式? 我給的代碼是:如何在android中提供粗體風格?

<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">

回答

22

這是因爲它是textStyle,不textstyle。這些屬性區分大小寫。在互聯網

<item name="android:textStyle">normal</item> 
+0

搜索或問其他問題,如果你沒有找到它的任何地方 – Prasham 2011-02-10 07:17:53

相關問題