当前位置:网站首页>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
边栏推荐
- Treatment of incomplete display of listview height
- Accessing private members using templates
- Installation, use and problem summary of binlog2sql tool
- RPM package management
- SSDB基础3
- 高层次人才一站式服务平台开发 人才综合服务平台系统
- 12 examples to consolidate promise Foundation
- Sentinel规则持久化进Nacos
- Raspberry pie uses root operation, and the graphical interface uses its own file manager
- The type initializer for ‘Gdip‘ threw an exception
猜你喜欢

Raspberry pie uses root operation, and the graphical interface uses its own file manager

Eight bit binary multiplier VHDL

Client interns of a large factory share their experience face to face

FTP、ssh远程访问及控制

The difference between ordinary inner class and static inner class

Keysight has chosen what equipment to buy for you

Using Visual Studio code to develop Arduino

Solutions such as unknown or garbled code or certificate problem prompt in Charles's mobile phone packet capture, actual measurement.

Druid SQL和Security在美团点评的实践

MySQL Téléchargement et installation de la version Linux
随机推荐
Openharmony open source developer growth plan, looking for new open source forces that change the world!
The type initializer for ‘Gdip‘ threw an exception
Tencent map and high logo removal method
JVM的类加载过程
迁移学习进阶
Solutions such as unknown or garbled code or certificate problem prompt in Charles's mobile phone packet capture, actual measurement.
Quick start to static class variables
mysql通过binlog恢复或回滚数据
RPM package management
Seata handles distributed transactions
[play with lighthouse] Tencent cloud lightweight server builds a full platform video analysis video download website
Switching power supply design sharing and power supply design skills diagram
Raspberry pie 18b20 temperature
ESP32 LVGL8. 1 - msgbox message box (msgbox 28)
Sentinel rule persistence into Nacos
网络协议之:sctp流控制传输协议
[today in history] April 23: the first video uploaded on YouTube; Netease cloud music officially launched; The inventor of digital audio player was born
js 计算时间差
Esp32 (UART receiving and sending) - receiving and sending communication of serial port (4)
SSDB Foundation