2016-10-24 60 views
2

我想改變TextInputLayout提示文字樣式爲粗體。我變了顏色和其他樣式提示的樣式使用TextAppearance的:更改TextInputLayout只提示文本樣式

<style name="MyTextInputLayoutTheme" parent="@android:style/TextAppearance"> 
     <item name="android:layout_height">wrap_content</item> 
     <item name="android:layout_width">match_parent</item> 
     <item name="android:textColorHint">@color/black_50</item> 
     <item name="colorControlNormal">@color/green</item> 
     <item name="hintAnimationEnabled">false</item>   
    </style> 

我試圖設置

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

<item name="android:textStyle">bold</item> 

,但它不工作。提示文本始終具有編輯文本的樣式(如果EditText上是勇敢的,它會自動具有大膽暗示,如果不是,則提示爲正常):

enter image description here

回答

0

想到的最簡單的事情是這樣的:

strings.xml <string name="myHint"><b>Your hint here</b></string>
在你的layout.xml文件中<EditText android:hint="@string/myHint"/>