Phonegap:如何控制手机的字体大小? [英] Phonegap : how Control the font size of the Mobile?

查看:260
本文介绍了Phonegap:如何控制手机的字体大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Phonegap中我遇到了问题,如果我们将移动设备的字体大小从设置更改为正常到大,那么已应用到应用程序的CSS会中断。

In Phonegap I have come across the problem, that if we change the font size of the mobile device from the setting to normal to large then the css which has applied to the application breaks.

那么如何克服这个问题呢?我已经搜索了很多,但是找不到任何解决方案。

So how to overcome this problem ? I have searched a lot but not able to find any solution regarding it.

任何帮助或建议都会有所帮助。

Any help or advice would be helpful.

当设备字体大小正常时,它工作正常。
在这里图片

It works fine when device font-size is normal. Image here

当我将设备字体大小从设置>显示>字体更改为巨大
此处显示

As I change the device font-size from setting>Display>fonts to Huge Image here

推荐答案

完全按照我的需要找到解决方案。
使用此插件

Just found out the solution exactly as i need. By using this plugin.

只需在index.js的onDeviceReady函数中写下面的代码。

And Just write the following in your onDeviceReady function in index.js.

 if(window.MobileAccessibility){
        window.MobileAccessibility.usePreferredTextZoom(false);
    }

这将忽略系统字体首选项。

This will just ignore the system font preferences.

这篇关于Phonegap:如何控制手机的字体大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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