[LayaAir 2.0]调用创建微信授权按钮时,授权按钮有时候显示有时候不显示

在同一手机上,laya调用创建微信授权按钮,代码执行了没有异常情况,有时候表示授权按钮,有时候不显示,以下是我创建按钮代码
var button:Object = wx.createUserInfoButton(
            {
                type: 'image',
                image: GameConfig.ServerUrl + 'static/playgame.png',
                style:
                {
                    right: 30,
                    bottom: 30,
                    width: 297*0.45,
                    height: 98*0.45,
                    lineHeight: 98*0.45,
                    backgroundColor: '#ff0000',
                    color: '#ffffff',
                    textAlign: 'center',
                    fontSize: 16,
                    borderRadius: 4,
                    withCredentials:false
                }
            });
            
            button.onTap(function(res):void
            {
                if(res.errMsg=="getUserInfo:ok")
                {
                    UserManager.userInfo = res.userInfo;
                    //清除微信授权按钮
                    button.hide()
                    MenuView.instance.createMenuBtn();
                    SocketManager.instance.sendlogin();
                    //LayaSample.gameLoad.toStartGame() 
                }
                else
                {
                    console.log("授权失败");
                }
            });
            button.show();
已邀请:

Aar0n

赞同来自:

天蝎の尾巴 • 2019-03-14 15:03
问题找到 了!授权按钮只能用left,top,不能用right,bottom定位

Aar0n

赞同来自:

这个不属于引擎的问题,正常不会出问题的,检查一下哪里的问题,这个引擎查不了的

该问题目前已经被锁定, 无法添加新回复

商务合作
商务合作