美文网首页
2018-05-02 SPA IPhone X适配笔记

2018-05-02 SPA IPhone X适配笔记

作者: dyishi | 来源:发表于2018-05-02 17:42 被阅读0次

body {

background-color:#fbf9fe;

  height:100%;

  width:100%;

}

#app {

height:100%;

  overflow-y:scroll;

  -webkit-overflow-scrolling:touch;

}

.router-view {

padding-bottom:constant(safe-area-inset-bottom);

  padding-bottom:env(safe-area-inset-bottom);

}

H5 部分

对于非固定元素,#app开启滚动,.router-view的内容底部加padding,滚动到底部时就可以留一段空间,不会被小黑条挡住。

对于固定元素,只要相应设定边距就可以,比如:

    padding-bottom:constant(safe-area-inset-bottom);

    padding-bottom:env(safe-area-inset-bottom);

iOS客户端

webView要把bounces设为NO,防止在拖动页面时,由于scrolllView的弹性,出现页面露底。

相关文章

网友评论

      本文标题:2018-05-02 SPA IPhone X适配笔记

      本文链接:https://www.haomeiwen.com/subject/mgbcrftx.html