简体   繁体   中英

Device Fonts settings are affecting app fonts - Ionic 6 (Capacitor) Android

Our team is struggling with an issue in Ionic 6.

We would like our mobile app fonts to be independent of device fonts settings on Android phone. We would like, device fonts settings should not affect our app font size etc.

There is a plugin available for Ionic 3 (Cordova) But for Capacitor, we haven't found a solution.

Any help is appreciated

As already mentioned, you can use Cordova plugins in Capacitor too.

That being said, fixing the value of the textZoom property of your webView to 100(%) is all you need to achieve what you're after. You can do this, for example, in the onStart method of your MainActivity.kt/java .

override fun onStart() {
  ...
  bridge.webView.settings.textZoom = 100
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM