Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
236 views
in Technique[技术] by (71.8m points)

javascript - Phonegap : how Control the font size of the Mobile?

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...