0

i am applying bitmap font to textfield and its working fine but textfield hint text size is not set as per i have applied font created using resource editor.please help me here how to set text filed hint text size? i am using this code

emailtext.setHint("Email Address");

 Style styleTextfield=new Style();
 styleTextfield.setFont(font_textfield);
   styleTextfield.setFgColor(0x808080);

   emailtext.setSelectedStyle(styleTextfield);
   emailtext.setUnselectedStyle(styleTextfield);
   emailtext.setPressedStyle(styleTextfield);

2 Answers2

0

If you are using some .res file to customize your UI, the UIID to change the TextField's Hint text value is TextHint. Modify the font there, using the Resource editor, and you will change the TextField's hint style.

enter image description here

Mun0n
  • 4,438
  • 4
  • 28
  • 46
  • do you have any example code for this after editing .res file? – user3121668 Dec 20 '13 at 12:45
  • are you using the .res file? In the code you don't need to do anything, because the .res file will modify the native components look and feel – Mun0n Dec 20 '13 at 12:47
  • yes i am using one .res file in that i have created one bitmap font. – user3121668 Dec 20 '13 at 12:48
  • that created bitmap font give me effects in textfield text very good as per my need but not applying effect in that textfield with hint – user3121668 Dec 20 '13 at 12:49
  • did you create and modify the TextHint UIID? – Mun0n Dec 20 '13 at 13:02
  • actually i dont used UIID for TextHint in my code please give me that code i dont know how to use UIID?And also give me idea about how to fetch GUI that created in .res file and what code shoud i write for that in my coding file.? – user3121668 Dec 20 '13 at 13:08
0

What you want is to set the font of the unselected style of the TextField to be separate from the selected and pressed style :

 txtField.getUnselectedStyle().setFont(myHintFont);
Ajibola
  • 1,218
  • 16
  • 28