当前位置:网站首页>Modify the font size of hint in editext
Modify the font size of hint in editext
2022-04-23 19:08:00 【Little brother】
modify Hint Font size cannot be in xml Set in , Can only be set in code .
public class HintActivity extends Activity{
EditText editText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.hint);
editText=(EditText) findViewById(R.id.editText1);
SpannableString ss = new SpannableString(" I am a test hint");// Definition hint Value
AbsoluteSizeSpan ass = new AbsoluteSizeSpan(15,true);// Set font size true Indicates that the unit is sp
ss.setSpan(ass, 0, ss.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
editText.setHint(new SpannedString(ss));
}
}
OK, to be finished .
版权声明
本文为[Little brother]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210601422791.html
边栏推荐
- Nacos as service registry
- mysql_linux版本的下载及安装详解
- SQL常用的命令
- 7、 DOM (Part 2) - chapter after class exercises and answers
- Codeforces Round #784 (Div. 4)
- FTP, SSH Remote Access and control
- [play with lighthouse] Tencent cloud lightweight server builds a full platform video analysis video download website
- Raspberry pie 18b20 temperature
- Click the input box to pop up the keyboard layout and move up
- Yyds dry goods inventory stringprep --- Internet string preparation
猜你喜欢
随机推荐
Partage de la conception de l'alimentation électrique de commutation et illustration des compétences en conception de l'alimentation électrique
MVVM model
Esp32 (UART 485 communication) - 485 communication of serial port (3)
2022.04.23 (the best time for lc_714_to buy and sell stocks, including handling charges)
SSDB基础
Codeforces Round #784 (Div. 4)
Zlib realizes streaming decompression
ESP32 LVGL8. 1 - bar progress bar (bar 21)
About the operation of unit file reading (I)
SSDB foundation 2
Tencent map and high logo removal method
js 计算时间差
Sentinel规则持久化进Nacos
Esp32 drive encoder -- siq-02fvs3 (vscade + IDF)
Esp01s with Arduino development environment
网络协议之:sctp流控制传输协议
SSDB基础3
Implementation of TCP UDP communication with golang language
Tencent cloud GPU best practices - remote development training using jupyter pycharm
The type initializer for ‘Gdip‘ threw an exception









