Pay*_*yar 4 react-native react-native-ios react-native-webview
我已经用于react-native-webview呈现HTML文本。但是在iOS中文本太小,而在android中则太完美了。
以下是代码行:
import { WebView } from "react-native-webview";
render() {
<WebView
originWhitelist={['*']}
source={{ html: '<p>This is a static HTML source!</p>' }}
/>
}
Run Code Online (Sandbox Code Playgroud)
附屏幕截图:
Pay*_*yar 10
使用视口元标记控制移动浏览器上的布局
<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>' }}
/>
Run Code Online (Sandbox Code Playgroud)
链接:https : //github.com/react-native-community/react-native-webview/issues/386
| 归档时间: |
|
| 查看次数: |
1103 次 |
| 最近记录: |