let wPos = dialog.singleButton.node.convertToWorldSpaceAR(cc.Vec2.ZERO);
let scale = (wx.getSystemInfoSync().windowWidth / (cc.view.getVisibleSize().width));
let imgSize = cc.size(174, 80)
let updateButton = wx.createUserInfoButton({
type: 'text',
text: "", // 不显示,空按钮
style: {
left: wPos.x - (imgSize.width / 2),
bottom: wPos.y - (imgSize.height / 2),
width: imgSize.width,
height: imgSize.height,
scale: scale,
}
});
通过以上方式创建按钮,微信6.7.3版本Android系统下,只要设置style中的bottom属性就会出现按钮消失的问题,iOS正常,之前的微信版本也正常。不得不吐槽一下,一直以为坐标没算好,调了很久才发现是bottom的问题。解决方法:用top代替就没问题了