一 蛉幸、UIWebview全屏適配
鍵盤彈出時(shí)候Simulator Screen Shot - iPhone X - 2019-04-29 at 16.13.09.png
1 iOS端 加上
if (@available(iOS 11.0, *)) {
[[UIScrollView appearance] setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
}else{
self.automaticallyAdjustsScrollViewInsets = NO;
}
加入這段話破讨,使UIScrollView自視圖不受安全區(qū)域影響造成布局亂變化
H5 端
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<head>
<title></title>
<style>
html,body{
height:100%;
background: yellowgreen;
color:#fff;
}
</style>
</head>
</head>
<body bgcolor="yellow">
<form action="/demo/demo_form.asp">
First name:<br>
<input type="text" name="firstname" value="Mickey">
<br>
Last name:<br>
<input type="text" name="lastname" value="Mouse">
<br><br>
<input type="submit" value="Submit">
</form>
<p>如果您點(diǎn)擊提交旨巷,表單數(shù)據(jù)會(huì)被發(fā)送到名為 demo_form.asp 的頁(yè)面。</p>
</body>
</html>
viewport-fit=cover 是設(shè)置Html 可以撐滿iOS設(shè)備的安全區(qū)域
Simulator Screen Shot - iPhone X - 2019-04-29 at 16.14.44.png
參考文章1:http://guokelide.com/2018/03/13/%E7%AC%AC3%E7%AF%87-Wkwebview%E9%80%82%E9%85%8DiPhoneX%E8%B8%A9%E5%9D%91%E8%AE%B0/
參考文章2:https://cloud.tencent.com/developer/article/1006338