用户信息按钮不显示
发布于 6 年前 作者 qiangzheng 12324 次浏览 来自 问答

用户信息按钮有时显示,有时不显示(大多数时候不显示),昨天开始出现这个问题

正常是这样子

代码

userInfoButton = wx.createUserInfoButton({

   type: ‘image’,

   image: ‘new/indexbtn.png’,

   style: {

     left: (sysInfo.screenWidth - userInfoButtonWidth) / 2,

     bottom: 70,

     width: userInfoButtonWidth,

     height: 111 * rate,

     lineHeight: 40,

     backgroundColor: ‘#ff0000’,

     color: ‘#ffffff’,

     textAlign: ‘center’,

     fontSize: 16,

     borderRadius: 4

   }

 })

3 回复

找到问题了,wx.createUserInfoButton style属性中的bottom和right属性已经删除了,使用left和top属性就好了。微信官方也不出个通知,这种接口也是可以随意修改的?

提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

应该是坐标问题,楼主试试把bottom去掉

回到顶部