当前位置:网站首页>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
边栏推荐
猜你喜欢

ESP32 LVGL8. 1 - textarea text area (textarea 26)

OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!

Android Development: the client obtains the latest value in the database in real time and displays it on the interface

8266 obtain 18b20 temperature

Esp32 (UART event) - serial port event learning (1)

微搭低代码零基础入门课(第三课)
![[报告] Microsoft :Application of deep learning methods in speech enhancement](/img/29/2d2addd826359fdb0920e06ebedd29.png)
[报告] Microsoft :Application of deep learning methods in speech enhancement

该买什么设备,Keysight 给你挑好了

ESP32 LVGL8. 1 - bar progress bar (bar 21)

Simplified path (force buckle 71)
随机推荐
从技术体系到商业洞察,中小研发团队架构实践之收尾篇
On the forced conversion of C language pointer
2022.04.23(LC_763_划分字母区间)
Esp32 (UART ecoh) - serial port echo worm learning (2)
该买什么设备,Keysight 给你挑好了
Implementation of TCP UDP communication with golang language
Scrollto and scrollby
中金财富怎么样?在上边开户安全吗
Treatment of incomplete display of listview height
Codeforces Round #784 (Div. 4)
Nacos as service registry
ESP32 LVGL8. 1 - checkbox (checkbox 23)
c#:泛型反射
Disable Ctrl + Alt + Del
FTP、ssh远程访问及控制
FTP, SSH Remote Access and control
mysql_ Download and installation of Linux version
PyGame tank battle
Practice of Druid SQL and security in meituan review
Screen right-click menu in souI