当前位置:网站首页>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
边栏推荐
- One stop service platform for high-level talents and development of comprehensive service platform system for talents
- Sentinel规则持久化进Nacos
- Network protocol: SCTP flow control transmission protocol
- C1000k TCP connection upper limit test 1
- Recyclerview control list item layout match_ Fundamental principle of parent attribute invalidation
- C: generic reflection
- ESP32 LVGL8. 1 - checkbox (checkbox 23)
- Esp32 (UART receiving and sending) - receiving and sending communication of serial port (4)
- Codeforces Round #784 (Div. 4)
- Treatment of incomplete display of listview height
猜你喜欢
binlog2sql 工具安装使用及问题汇总
Client interns of a large factory share their experience face to face
2022.04.23(LC_714_买卖股票的最佳时机含手续费)
Raspberry pie 18b20 temperature
Esp32 (UART 485 communication) - 485 communication of serial port (3)
Download xshell 6 and xftp6 official websites
MVVM model
C: generic reflection
[record] typeerror: this getOptions is not a function
I just want to leave a note for myself
随机推荐
Seata handles distributed transactions
程序员如何快速开发高质量的代码?
Getting started with vcpkg
Keysight has chosen what equipment to buy for you
Switching power supply design sharing and power supply design skills diagram
Treatment of incomplete display of listview height
c#:泛型反射
Using bafayun to control the computer
After opening the original normal project, the dependency package displays red and does not exist.
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
Sogou cell thesaurus analysis (only extract words and word frequency)
Dynamically add and delete layouts
Quick start to static class variables
開關電源設計分享及電源設計技巧圖解
[play with lighthouse] Tencent cloud lightweight server builds a full platform video analysis video download website
One of the reasons why the WebView web page cannot be opened (and some WebView problem records encountered by myself)
Go 语言 GUI 框架 fyne 中文乱码或者不显示的问题
Implementation of TCP UDP communication with golang language
ESP32 LVGL8. 1 - arc (arc 19)
腾讯云GPU最佳实践-使用jupyter pycharm远程开发训练