开发者

How can I create a textview that automatically changes it's font size to fit the space?

开发者 https://www.devze.com 2023-01-31 10:42 出处:网络
I am wondering how can I create or use if exists feature of TextView, to automatically change it\'s font size to fit the place.

I am wondering how can I create or use if exists feature of TextView, to automatically change it's font size to fit the place.

Sometime开发者_开发技巧s it should be larger if has space, and sometimes it should shrink in font size to fit the space.

What do you say?


you can change the font in your overrided version of

protected void onSizeChanged (int w, int h, int oldw, int oldh)

method.You need just to subclass TextView to do it.

Also, check this.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号