undefinedfix
Sign in

Android embedded H5 page, font setting failure

Durapub edited in Wed, 29 Jun 2022

First of all, let's explain the problem: there is a front-end H5 system announcement page embedded in android app, which is generated with a template H5 page. I don't know how to generate it (I am the front end). After the generation, I directly open the page as follows:

clipboard.png

The font size is normal, which meets the expectation. Then open it on the app, and the effect is as follows:

As shown in the figure above. I tried all kinds of methods, but I couldn't solve the problem of smaller font ...

In addition, it seems that IOS is normal. I have also added some common adaptations (mainly meta tags) to the template, as follows:

        <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
        <meta http-equiv="X-UA-Compatible" content="edge" />
        <meta name="renderer" content="webkit">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta content="telephone=no" name="format-detection">
        <meta content="email=no" name="format-detection">
        <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
        <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-touch-fullscreen" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">

It also introduces a JS plug-in used previously to do screen adaptation. All invalid

I personally feel that this estimation is a problem with Android, but I don't understand Android, and I don't know if there are any settings that can solve it, and if there are any partners who know the reason?

4 Replies
qysgr
commented on Wed, 29 Jun 2022

The baseline values of line height and font size of WebView CSS are different.

Scard
commented on Wed, 29 Jun 2022

Feel upstairs is right, suggest Android set benchmark try

Jinja_dude
commented on Thu, 30 Jun 2022

I threw this pot to Android, and then I don't know how she did it. OK, although it's a little different, it's acceptable

Mahdi
commented on Thu, 30 Jun 2022

There are several types of font size that can be set for WebView in Android, but the specific size cannot be set, such as 15px

lock This question has been locked and the reply function has been disabled.