ios中scroll-view组件的bindscrolltoupper事件和bindscrolltolower事件 无法实现scroll-into-view功能(在没加scroll-with-animation的前提下 不需要过渡效果)
scroll-into-view 这个好像只能等页面渲染完成并且不滚动了之后1000ms左右 再设置才能生效 那效果可真的没法看
data: {
idd:null,
},
bindscrolltoupper: function() {
this.setData({
idd: ‘s20185’
})},
bindscrolltolower: function() {
this.setData({
idd: ‘s20185’
})},
<scroll-view scroll-y bindscrolltoupper=“bindscrolltoupper” bindscrolltolower=“bindscrolltolower” scroll-into-view="{{idd}}" style=‘height: 600rpx;’>
<view id=‘s1231’ style=‘height: 600rpx; background: red’>1</view>
<view id=‘s1231’ style=‘height: 600rpx; background: red’>2</view>
<view id=‘s20185’ style=‘height: 600rpx; background: yellow’>3</view>
<view id=‘s1231’ style=‘height: 600rpx; background: red’>4</view>
<view id=‘s1231’ style=‘height: 600rpx; background: red’>5</view>
</scroll-view>