如何使字体大小的应用没有得到通过更改设置字体大小影响 [英] How to make font sizes in app to not get effected by changing Settings Font size

查看:181
本文介绍了如何使字体大小的应用没有得到通过更改设置字体大小影响的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的应用程序按设计运行良好时,字体大小是在正常的设置 - >显示 - >字号。

I have my app running well as per design when the font size is at "Normal" on Settings->Display->FontSize.

当我改变字体大小小/大全部内容混搭。我的应用程序是内容密集型的,这是严重影响的应用程序。

When i change the font size to Small/Large entire content is mashed up. My app is content intensive and this is badly effecting the app.

可以说,行动起来吧标题,如隐私权和设置。标题逃跑的边界/时的字体大小设置为大的系统设定ellipsizes。 ListView控件的内容看可怜。

Lets say, action bar title is like "Privacy and Settings". The title runs off the bounds/ellipsizes when font size is set to "Large" in System Settings. The listview contents look pathetic.

有没有一种方法,以确保在设置 - >字体的改变不会影响我们的应用程序?

Is there a way to make sure that the change in Settings->Fonts doesn't effect our app?

Flipboard的应用程序做到这一点。

Flipboard app does that.

推荐答案

我终于得到了解决。
谷歌严格推荐使用SP的字体。但是,如果您不希望根据用户的字体设置缩放文本,使用DP。如果你去设置 - >字体,字体大小不会在给定的设备改变。你的UI仍将就像你设计它。

I finally got the solution. Google strictly recommends to use "sp" for fonts. However, if you do not want the text to be scaled based on user font settings, use "dp". The font size will not change in a given device if you go to settings->fonts. Your UI will remain just like you designed it for.

感谢Aswin你的投入。并感谢约瑟夫伯爵在<一个答题href=\"http://stackoverflow.com/questions/11638691/android-sp-vs-dp-texts-what-would-adjust-the-scale-and-philosophy-of-support\">Android SP VS DP文本 - 什么会调整规模和支持哲学

Thanks Aswin for your inputs. And thanks to Joseph Earl for answering question at Android sp vs dp texts - what would adjust the 'scale' and philosophy of support

这篇关于如何使字体大小的应用没有得到通过更改设置字体大小影响的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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