我使用过react-native-webview来渲染超文本标记语言文本。但是文本在iOS中太小了,而在安卓中却很完美。
下面是几行代码:
import { WebView } from "react-native-webview";
render() {
<WebView
originWhitelist={['*']}
source={{ html: '<p>This is a static HTML source!</p>' }}
/>
}附加截图:

发布于 2019-03-05 15:54:33
使用viewport meta标记控制移动浏览器上的布局
<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
发布于 2019-11-06 21:10:00
此外,对于<meta>,您可以将<style>标记添加到<head>部分以缩放字体:
<style>
body { font-size: 120%; word-wrap: break-word; overflow-wrap: break-word; }
</style>https://stackoverflow.com/questions/54997381
复制相似问题