react-native-webview : iOS のテキストが小さすぎる 質問する

react-native-webview : iOS のテキストが小さすぎる 質問する

HTML テキストのレンダリングに使用しましたreact-native-webview。しかし、iOS ではテキストが小さすぎますが、Android では完璧です。

ここにコード行があります:

import { WebView } from "react-native-webview";


render() {
  <WebView
        originWhitelist={['*']}
        source={{ html: '<p>This is a static HTML source!</p>' }}
  />
}

スクリーンショットを添付します:

ここに画像の説明を入力してください

ベストアンサー1

ビューポートメタタグを使用してモバイルブラウザのレイアウトを制御する

<meta name="viewport" content="width=device-width, initial-scale=1">

<WebView
      originWhitelist={['*']}
      source={{ html: '<html><head><meta name="viewport" content="width=device-width, initial-scale=1.0"></head><body><p>This is a static HTML source!</p></body></html>' }}
/>

リンク :https://github.com/react-native-community/react-native-webview/issues/386

おすすめ記事