忽略ICS“字体大小设置 [英] Ignoring ICS' font size setting

查看:165
本文介绍了忽略ICS“字体大小设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Android应用程序,看起来绝对可怕如果用户设置他们的字体大小大或特大(​​通过设置 - >显示 - >在Ice Cream Sandwich的字体大小)。它只是普通的不是为可变字体大小,这使得很多文本的阅读。

I have an Android app that looks absolutely horrible if the user sets their font size to large or extra large (via Settings -> Display -> Font size in Ice Cream Sandwich). It just plain wasn't designed for variable font sizes, and it makes a lot of the text unreadable.

我已经看到了preserve的字体大小对于大多数应用程序的意见,所以我知道必须有一个办法做到这一点。有我一个简单的方法来告诉应用程序忽略用户的字体大小preference?如果没有,你会如何建议我去计算字体大小?如果不出意外,有没有办法对我来说,检索用户的字体大小preference?

I've seen applications that preserve the font size for most views, so I know that there has to be a way to do this. Is there a simple way for me to tell the application to ignore the user's font size preference? And if there isn't, how would you suggest that I go about calculating the font sizes? If nothing else, is there a way for me to retrieve the user's font size preference?

推荐答案

我想你想要做的是在DP指定的字体大小,而不是SP。所有的SP采取单位用户的字体大小preferences考虑调整它们的大小时,而DP单位只是基于设备的像素密度计算的大小。

I think what you want to do is specify your font sizes in "dp" instead of "sp". All sp units take user font size preferences into account when adjusting their size, while dp units only calculate size based on the device's pixel density.

这篇关于忽略ICS“字体大小设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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