分享你我的心得.
共乘一片美好网络.

小程序在IOS苹果系统下使用wx.showModal文字不显示的BUG

深浅主题下显示不一致问题

浅色模式下按钮文字看不见了

深色模式下能正常显示

代码实现

x.showModal({
    title: '提示',
    content: '只有圈子认证后才能使用通讯助手哦',
    showCancel: true,
    cancelText: '取消',
    cancelColor: '#000000',
    confirmText: '认证',
    confirmColor: 'rgba(82, 107, 177, 1)',
    success: (result) => {
        if (result.confirm) {
            // 前往认证
            wx.navigateTo({
                url: '../circle-affirm/circle-affirm'
            })
        }
    },
    fail: () => {},
    complete: () => {}
});

问题根源

cancelColor、confirmColor 必须是16进制格式的颜色字符串

解决办法

x.showModal({
    title: '提示',
    content: '只有圈子认证后才能使用通讯助手哦',
    showCancel: true,
    cancelText: '取消',
    cancelColor: '#000000',
    confirmText: '认证',
    confirmColor: '#526BB1', //改了这里!
    success: (result) => {
        if (result.confirm) {
            // 前往认证
            wx.navigateTo({
                url: '../circle/circle'
            })
        }
    },
    fail: () => {},
    complete: () => {}
});

赞(0)
未经允许不得转载:小叶白龙博客 » 小程序在IOS苹果系统下使用wx.showModal文字不显示的BUG
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址