- 一个页面如下结构:
<view class="flex-column"> <scroll-view class="flex-grow" scroll-y> <view class="content"><view>content</view></view> </scroll-view> <view class="other-height"></view></view> |
这里使用了`flex`布局,我让`scroll-view`高度自适应,然后需要对`scroll-view`下的子元素垂直居中,但我不能设置`scroll-view`为`flex`,我想到了另一个解决方案,就是对`.content`的最小高度设置100%,`min-height: 100%`,并且是`flex-column`和`center`,内容多了,`scroll-view`就出现滚动条,内容少了,就垂直居中,安卓上面很好,但ios对100%的设置不起作用,那么垂直居中也就不能实现了
