android怎么解决app的字体大小随着手机设置的字体大小改变的现象?
巴扎黑
巴扎黑 2017-04-17 15:42:33
0
3
854
  1. 描述你的问题
    刚做完的项目,事先没想到,后来有用户反馈内容没显示完整,最后发现他手机设置里面把字体大小调到最大了,字体调小之后就正常。现在是用这个方法不让app里面的字体大小改变,想问下有没有别的方法可以解决。

  2. 贴上相关代码
    @Override
    public Resources getResources() {

       // TODO Auto-generated method stub
       Resources res = super.getResources();
       Configuration config = new Configuration();
       config.setToDefaults();
       res.updateConfiguration(config, res.getDisplayMetrics());
       return res;

    }

巴扎黑
巴扎黑

reply all(3)
Peter_Zhu

textSize uses dp as the unit
But it is not recommended to do this. To solve your problem, it is better to make the textview size adaptive and scrollable

PHPzhong

Is this your question template for trolling? Why were the three, four and five points sent out without completing them?

Peter_Zhu

The font size unit is dp

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template