flex page height 100% 仍会上下滚动
发布于 4 年前 作者 ewan 18514 次浏览 来自 问答

iOS下才有这个问题,Android下不会。

wxml包含header、body、footer三段,其中body是scroll-view:

<view class=“page-header”>…

<scroll-view class=“page-body”>…

<view class=“page-footer”>…

wxss:

page{

  height: 100%;

  width: 100%;

  display: flex;

  flex-direction: column;

}

body的内容可以上下滚动,但滚动到底时,继续滚会导致整个页面上滚,导致首尾不该滚动的部分滚动了

4 回复

scroll-view增加下面(粗体)样式解决了这个问题:

.page-body{

  display: flex;

  flex: 1;

  flex-direction: column;

  height: 100%;

  overflow-y: auto;

  -webkit-overflow-scrolling: touch;

}

@Special

公司多部iPhone试了都有这个问题(大部分都是iOS10)。已经开启“上传代码时样式文件自动补全”。

不管用啊,我按楼上方法加了,页面仍在上下滑动。

iOS 几的系统?

开一下开发者工具的 上传代码时样式文件自动补全 看看?

回到顶部