I developed a Cordoba app with Cordoba version 3.6.3 and jQuery. The only problem that I still can’t get the best solutions for is when I test my application on Android 4.4+, and there are users who like to change the font size in the settings> display> font-size of their device to be larger normal, This leads to the fact that the layout of my application looks ugly (the best screen is when the font size setting is normal). But there is no effect of font size adjustment for Android older than 4.4 (4.3,4.2 ...). Thus, the application is displayed perfectly in the old version.
The solutions I applied to my application is to create a custom plugin to change the configuration, and it will detect if the user is using Android 4.4+, and if they set the font size setting to anything that is not normal, I use jQuery to format the size font to the specified size.
Example:
if (font_scale == huge) { $("div").css("font-size","20px !important"); }
This works great, but sometimes after loading the css page it doesn't change as I want. And suppose if there are 30 div + on this page, so I have to insert the instruction as described above 30 times, and it takes too much time.
I just want to know if there are other ways to solve this problem, which is easier than using this plugin? Perhaps using some XML properties or CSS3 properties that can cause my application to display correctly without the side effect of adjusting the font size of Android 4.4?
Other ways that I also tried and it doesn’t work,
- paste fontScale on Androidmanifest.xml> activity tag
- insert webkit-text-size-adjust: none; in css
I would like to hear any ideas that will help solve this problem.
source share