反馈一个 Bug
发布于 5 年前 作者 kchen 12129 次浏览 来自 问答

最新版微信下

movable-area组件

动态的设置宽高

movable-view的位置异常

5 回复

请问楼主 我设置了 x和y 却无法水平划动

<movable-area  data-id=’{{item.recordtId}}’ data-index=’{{index}}’ bindtap=‘btnUp’  style=“width: 100%; height: 104px; padding-left: 100px; left: -100px; background-color: #ccc;”>

<movable-view inertia=“true” direction=“horizontal” x=“200” y=“0” style=“width: {{windowWidth}}px; height: 104px; background-color: #f00; z-index: 3;”>

</movable-view>

</movable-area>

windowWidth是我用 wx.getSystemInfoSync();获取的宽度

请给详细的代码示例

认真看文档好吗,

out-of-boundsBooleanfalse超过可移动区域后,movable-view是否还可以移动

请问楼主这个问题有解决方案了吗?

<movable-area catchtouchmove=“doNothing” style=“height:{{height}}px”>

 <movable-view x="{{x}}" y="{{y}}" direction=“all” out-of-bounds=“false”>

 </movable-view>

</movable-area>

<------------------------------------->

wx.getSystemInfo({

success: function (res) {

var height = res.screenHeight - (res.screenHeight - res.windowHeight);

if (res.platform == ‘ios’) {

height = height - 49;

} else if (res.platform == ‘android’) {

height = height + 46;

}

var tranX = (res.windowWidth - 0) * 0.82;

var tranY = height * 0.66;

that.setData({

x: tranX,

y: tranY,

height: height,

})

}

})

回到顶部