不同分辨率的文字大小 [英] Text size with different resolution

查看:225
本文介绍了不同分辨率的文字大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Galaxy Tab的1,7寸华电国际和Galaxy Tab的加分,7寸的华电国际,但更高的分辨率,而在我的应用程序,文字可以读罚款的Galaxy Tab,但在Galaxy Tab的再加上有太多的小。 使用SP的字体大小和布局,大型林。任何想法?谢谢

i am using a galaxy tab 1, 7inch hdpi and a galaxy tab plus, 7 inch hdpi but more resolution, and in my application, the text can be read fine in galaxy tab but in galaxy tab plus there are too much small. Im using sp in font size and layout-large. Any idea? Thanks

推荐答案

这应该是一些帮助你,如果你想通过程序设置的大小。文本将在相同的大小显示每个设备上的

This should be some help for you if you want to set size programmatically. Text will show in the same size on each device

TextView text = new TextView(this);
text.setText("text");
text.setTextSize(16 * getResources().getDisplayMetrics().density);

这篇关于不同分辨率的文字大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆