按照例子写的获取用户信息按钮,log里面已生成button,为何界面没有任何显示

发布于 8 年前作者 dinggang16207 次浏览最后编辑 8 年前来自 ask

start () {

    this.createButton();

},

createButton: function(){

    var button = wx.createUserInfoButton({

        type: ‘text’,

        text: ‘获取用户信息’,

        style: {

            left: 10,

            top: 76,

            width: 200,

            height: 40,

            lineHeight: 40,

            backgroundColor: ‘#ff0000’,

            color: ‘#ffffff’,

            textAlign: ‘center’,

            fontSize: 16,

            borderRadius: 4

        }

    })

    console.log(“button::::::::::”+button);

    button.onTap((res) => {

    console.log(res)

    })

},

完全按照例子写的获取用户信息按钮,log里面已经生成button,为何界面没有任何显示,多次尝试都不成功;请大神指路

1 回复
mingyan
mingyan1 楼6 年前

需要真机调试