Phonegap - 忽略Android上的字体大小显示设置 [英] Phonegap - Ignore font-size display setting on Android

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

问题描述

我通过配置更改字体大小显示设置时遇到了一些Android设备的问题。

I'm having an issue with some android devices when changing the font-size display setting through configuration.

在网络浏览器中,我的应用程序忽略了这一点。

In web browser my app is simple ignoring this. This is true for some other mobiles too.

但是对于一些特定的手机(如摩托罗拉G或X),更改此配置也会影响我的Phonegap应用程序。

But with some specific mobiles (like Motorola G or X) changing this config also affects my Phonegap app.

我不知道如何避免这种情况使应用程序看起来一致

I don't know how to avoid this to make the app look consistent

推荐答案

我找到了一个使用此cordova插件的解决方案: com.phonegap.plugin.mobile-accessibility

I've found a solution using this cordova plugin: com.phonegap.plugin.mobile-accessibility

您必须遵循该插件的安装说明,然后才能在Ionic应用程序中使用它。你只需要确保在Cordova的deviceready回调函数(在下面的例子中由$ ionicPlatform.ready访问)后调用它的函数:

You have to follow installation instructions for the plugin, and then you can use it inside Ionic app. You only have to ensure to call its functions after Cordova 'deviceready' callback (accesed by $ionicPlatform.ready in the example below):

angular.module('app').controller('IndexController', function ($ionicPlatform, $window) {

    $ionicPlatform.ready(function(){
        if($window.MobileAccessibility){
            $window.MobileAccessibility.usePreferredTextZoom(false);
        }
    });
});

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

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