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

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适配笔记)