Flutter WebView字体大小比应该的要大。

huangapple go评论90阅读模式
英文:

Flutter WebView font size is bigger than it should be

问题

I'm currently rendering this website using flutter_inappwebview and everything works fine but I noticed some texts have bigger size than normal. This is happening throughout the app. We use rem units to define font-size in the css. Could this be related?

我目前正在使用 flutter_inappwebview 渲染此网站,一切都正常,但我注意到一些文本的大小比正常要大。这在整个应用程序中都发生。我们在CSS中使用 rem 单位来定义 font-size,这可能与此有关吗?

I found android webview settings have minimumFontSize but this problem is happening on iOS.

我发现 Android WebView 设置中有 minimumFontSize,但这个问题发生在 iOS 上。

How it looks on Web
Flutter WebView字体大小比应该的要大。

在Web上的显示方式
Flutter WebView字体大小比应该的要大。

How it looks using Flutter Webview (ios simulator)
Flutter WebView字体大小比应该的要大。

在Flutter Webview(iOS模拟器)上的显示方式
Flutter WebView字体大小比应该的要大。

I already tried something like

   crossPlatform: InAppWebViewOptions(
      minimumFontSize: 1,
    ),

但我认为这只是一个真正影响 Android 设备的设置。

英文:

I'm currently rendering this website using flutter_inappwebview and everything works fine but I noticed some texts have bigger size than normal. This is happening throughout the app. We use rem units to define font-size in the css. Could this be related?

I found android webview settings have minimumFontSize but this problem is happening on iOS.

How it looks on Web
Flutter WebView字体大小比应该的要大。

How it looks using Flutter Webview (ios simulator)
Flutter WebView字体大小比应该的要大。

I already tried something like

   crossPlatform: InAppWebViewOptions(
      minimumFontSize: 1,
    ),

But I think this is a setting that only really affects android devices.

答案1

得分: 2

这不是一个关于Flutter/Webview的问题。事实上,在iOS的Safari应用中,您应该看到比正常情况下更大的字体。要解决这个问题,您可以参考与此问题相关的其他问题:https://stackoverflow.com/questions/62668640/why-is-font-size-different-on-ios-chrome-v-ios-safari

英文:

This is not a flutter/webview question. In fact in the safari app for iOS, you should see similar larger fonts than normal. To solve this, you can refer to other issues mentioned around this issue:
https://stackoverflow.com/questions/62668640/why-is-font-size-different-on-ios-chrome-v-ios-safari

huangapple
  • 本文由 发表于 2023年1月6日 13:47:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/75027376.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定