React native webView Ios端禁止手势放大
来源:互联网 发布:国产蓝牙耳机知乎 编辑:程序博客网 时间:2024/04/30 11:14
如果是加载静态资源html标签,需要写全整个html页面,如下:
const htmlContent = '<!DOCTYPE html><html><body>' + '<head>'+ '<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">'+ '</head>'+ `${content}` + '<script>' + 'window.onload=function(){' + 'var height = document.body.clientHeight;' + 'window.location.hash = "#" + height;document["title"] = height;};' + 'function _onclick(data) {WebViewBridge.send(data);}'+ '</script>' + '</body></html>';<webView source={{html:htmlContent}} 其他配置省略.../>
其中在head中加入:
<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
这句话是关键。
同理,如果加载的是动态的html页面,也需要在该页面的head标签内加上这句话
0 0
- React native webView Ios端禁止手势放大
- React Native 五:手势
- React Native手势识别
- React Native Webview使用
- React Native WebView自适应高度(Android、IOS平台通用)
- react native Webview ios <Error>: CGAffineTransformInvert: singular matrix.
- React Native iOS端打包
- react-native 手势应答系统
- React Native手势处理详解
- React Native之手势bug
- React Native 手势响应系统
- React Native手势密码组件
- iOS 禁止滑动手势
- react-native手势及与java端交互应用
- 【React native】Webview的使用
- React native Webview的使用
- React Native控件之WebView
- React Native学习八- WebView
- 系统对象的方法
- ConcurrentQueue的内存泄露BUG
- poj 2421 Constructing Roads kruskal克鲁斯卡尔最小生成树
- Error: Android SDK not found. Make sure that it is installed. If it is not at the default location,
- (hdu1007)Quoit Design,求最近点对
- React native webView Ios端禁止手势放大
- 【数据结构】看图理解单链表的反转
- java将流水数据转化成稀疏格式的购物篮式public class AccountCode { private String accountCode; public String getAc数据
- JAVA源码解读之Vector
- (vue.js)vue 父组件使用keep-alive和infinite-scroll导致在子组件触发父组件的infinite-scroll方法
- 阿里云的maven配置(转)
- Gx接口diameter信令CER消息结构分析
- CodeForces
- 南阳oj 题目66 分数拆分