当前位置:网站首页>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
边栏推荐
- I just want to leave a note for myself
- 简化路径(力扣71)
- C: generic reflection
- Xlslib use
- On the forced conversion of C language pointer
- Simple use of navigation in jetpack
- js 计算时间差
- FTP、ssh远程访问及控制
- Sentinel service fusing practice (sentinel integration ribbon + openfeign + fallback)
- Introduction to micro build low code zero Foundation (lesson 3)
猜你喜欢
Esp32 (UART 485 communication) - 485 communication of serial port (3)
C: generic reflection
ESP32 LVGL8. 1 - input devices (input devices 18)
mysql_linux版本的下載及安裝詳解
Druid SQL和Security在美团点评的实践
Redis optimization series (III) solve common problems after master-slave configuration
ESP32 LVGL8. 1 - roller rolling (roller 24)
Partage de la conception de l'alimentation électrique de commutation et illustration des compétences en conception de l'alimentation électrique
为何PostgreSQL即将超越SQL Server?
Keysight has chosen what equipment to buy for you
随机推荐
Sentinel规则持久化进Nacos
mysql_linux版本的下載及安裝詳解
SSDB foundation 3
The difference between ordinary inner class and static inner class
About the operation of unit file reading (I)
[记录]TypeError: this.getOptions is not a function
浅谈c语言指针的强制转换
Sogou cell thesaurus analysis (only extract words and word frequency)
为何PostgreSQL即将超越SQL Server?
Sentinel服务熔断实战(sentinel整合ribbon+openFeign+fallback)
Nacos作为服务配置中心实战
Client interns of a large factory share their experience face to face
【玩转Lighthouse】腾讯云轻量服务器搭建全平台视频解析视频下载网站
Feature selection feature_ selection--SelectKBest
C1000k TCP connection upper limit test
An 8266 crash
Treatment of incomplete display of listview height
Recyclerview control list item layout match_ Fundamental principle of parent attribute invalidation
Esp32 (UART ecoh) - serial port echo worm learning (2)
c1000k TCP 连接上限测试1