不知道为什么。预览图片这个功能,在某些手机上(荣耀,魅族)打开关闭图片时屏幕都会抖一下,而在小米和客户端上时就不会抖,想问一下这是为什么??有没有解决的方法
wtml
<view class=‘picture’ bindtap=‘previewPicture2’ data-index=’{{index}}’>
<view >
<image class=‘picture_one’ mode=‘aspectFill’ wx:for="{{item.messagePicture}}" src="{{item}}" data-index=’{{index}}’ data-pic=’{{item}}’ bindtap=‘previewPicture’></image>
</view>
</view>
css
.picture{
margin-left: 176rpx;
width: auto;
height: auto;
}
.picture_one{
width: 160rpx;
height: 160rpx;
padding-right: 20rpx;
}
js
previewPicture2: function (e) {
console.log(e)
var that = this
var pic = that.data.pic
var index2=e.currentTarget.dataset.index
wx.previewImage({
current: pic, // 当前显示图片的http链接
urls: that.data.demands[index2].messagePicture // 需要预览的图片http链接列表
})
},
previewPicture: function (e) {
let that = this
console.log(e)
var pic = e.currentTarget.dataset.pic;
that.setData({
pic:pic
})
},