[android-beginners] Re: EditText appearance
You could create a colorstate list (xml file in res/drawable), for example http://developer.android.com/reference/android/content/res/ColorStateList.html Here is an example i used for textcolors. Should work for HintColors too! res/drawabale/myedittextcolors.xml: http://schemas.android.com/apk/res/android";> Now you only have to assign it to your EditText widget. Edit the XML and change android:textColorHint="#FF" to android:textColorHint="@drawable/myedittextcolors" and it should work. This is usefull if you want to have different colors depending on the state of the edittext (i.e. if its focused, clicked, etc). For one color, use android:textColorHint="#FF" or android:textColorHint="@color/ mycustomcolor" if you have defined your color in /res/values/ colors.xml On Mar 10, 11:30 am, "Mr.No" wrote: > Hello, > how do i change the size, style, typeface of a hint? > If the EditText gains the focus the border-color changes to orange, > how do i set a other color? > > rgds > Mr.No --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: EditText appearance
Can i assigne a colorstate list to the background? And how do i change the bordercolor when the edittext gains the focus, without placing a backgroundimage? Tseng schrieb: > You could create a colorstate list (xml file in res/drawable), for > example > http://developer.android.com/reference/android/content/res/ColorStateList.html > > Here is an example i used for textcolors. Should work for HintColors > too! > > res/drawabale/myedittextcolors.xml: > > > http://schemas.android.com/apk/res/android";> >android:state_focused="true" > android:state_pressed="false" > android:color="@android:color/secondary_text_dark" /> >android:state_focused="true" > android:state_pressed="true" > android:color="@android:color/secondary_text_dark" /> >android:state_focused="false" > android:state_pressed="true" > android:color="@android:color/secondary_text_dark" /> >android:color="@android:color/secondary_text_dark" /> > > > Now you only have to assign it to your EditText widget. > > Edit the XML and change > > android:textColorHint="#FF" > > to > > android:textColorHint="@drawable/myedittextcolors" > > and it should work. This is usefull if you want to have different > colors depending on the state of the edittext (i.e. if its focused, > clicked, etc). > > For one color, > use android:textColorHint="#FF" or android:textColorHint="@color/ > mycustomcolor" if you have defined your color in /res/values/ > colors.xml > > > > > > > > On Mar 10, 11:30 am, "Mr.No" wrote: > > Hello, > > how do i change the size, style, typeface of a hint? > > If the EditText gains the focus the border-color changes to orange, > > how do i set a other color? > > > > rgds > > Mr.No --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: EditText appearance
thx a lot :) On 10 Mrz., 11:30, "Mr.No" wrote: > Hello, > how do i change the size, style, typeface of a hint? > If the EditText gains the focus the border-color changes to orange, > how do i set a other color? > > rgds > Mr.No --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---