EditText appearance

by Mr.No » Tue, 10 Mar 2009 17:06:52 GMT


Sponsored Links
 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
--~--~---------~--~----~------------~-------~--~----~



EditText appearance

by Mr.No » Tue, 10 Mar 2009 18:31:04 GMT


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


Sponsored Links


EditText appearance

by Tseng » Wed, 11 Mar 2009 19:42:09 GMT


 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:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android=" http://schemas.android.com/apk/res/android" ;>
    <item
        android:state_focused="true"
        android:state_pressed="false"
                android:color="@android:color/secondary_text_dark" />
    <item
        android:state_focused="true"
        android:state_pressed="true"
                android:color="@android:color/secondary_text_dark" />
    <item
        android:state_focused="false"
        android:state_pressed="true"
                android:color="@android:color/secondary_text_dark" />
    <item
        android:color="@android:color/secondary_text_dark" />
</selector>

Now you only have to assign it to your EditText widget.

Edit the XML and change

android:textColorHint="#FFFFFF"

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="#FFFFFF" or android:textColorHint="@color/
mycustomcolor" if you have defined your color in /res/values/
colors.xml









--~--~---------~--~----~------------~-------~--~----~



EditText appearance

by Mr.No » Thu, 12 Mar 2009 17:36:28 GMT


 thx a lot :)



--~--~---------~--~----~------------~-------~--~----~



EditText appearance

by Mr.No » Thu, 12 Mar 2009 18:06:37 GMT


 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:

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Zii Egg's Android OS

As you all can see in this image: 
http://www.ziilabs.com/content_images/resource/DG-Zii%20EGG%20Specs.jpg
thay have two hardware buttons: HOME and CAMERA buttons (Power it's
Power) so where is the MENU button, because as I saw in thier movies
when he press CAMERA button goes BACK, so MENU is missing.
MENU button could be a software button?
They build a custom Android OS to fit their hardware, so this could be
done, to have only one hardware button or none on Android.
What do you think?

--~--~---------~--~----~------------~-------~--~----~

2. SDK provided images

Hi,

There are images provided in android-sdk-windows-1.5_r2\platforms
\android-1.5\data\res\drawable
folder of SDK.

Is there any way that we can use those directly in appliation.
(without local copy)?


Thanks & best Regards;

Swapnil Dalal

--~--~---------~--~----~------------~-------~--~----~

3. android hello program

4. listview activity not stopping

5. How did they made those "solve the math to dismiss the Alarm Clock" type apps?

6. Threads for networking and DatagramSocket

7. pthread lib problem