开发者

Android font sizing - ensuring X chars fits into a textview

Is there any way to ensure that I can fit X numbers of characters (fixed width font) into a text view?

No code as of yet as it's still in design - I already know how much space I want 开发者_JAVA百科the textview to take up (using weights so the width will be relative to the system it's on and the orientation. So the question is really to do with dynamic sizing of the text, i.e. I want to ensure that I can fit up to 4 digits into a single box.

Thanks!


You can use

android:ems="4"

this means that the textView will be always the width of 4 letters 'M' (MMMM).

If you use

android:minEms="4"

then the textView width will be at least 4 letters 'M'

P.S: Sorry for my english...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜