收藏
回答

showTabBarRedDot和setTabBarBadge位置偏移

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug showTabBarRedDot 工具 7.0.5 2.7.0


- 预期表现


这是在开发者工具上正常显示的样子


- 当前 Bug 的表现(可附上截图)


这是在手机上的样子

不管是showTabBarRedDot还是setTabBarBadge,位置都会一样的偏移,请问是怎么回事,代码也简单,不存在复杂的逻辑

以下是测试用的代码

app.json

{

"pagePath": "pages/me/me",

"text": "个人中心",

"iconPath": "pages/image/tabbar/icons_me.png",

"selectedIconPath": "pages/image/tabbar/icons_me-selected.png"

}


index.js

  /**

  * 生命周期函数--监听页面显示

  */

onShow: function () {

    if (1 == 1) {

        wx.showTabBarRedDot({

        index: 3,          

        })

    } else {

        wx.hideTabBarRedDot({

        index: 3,

        })

    }

}


最后一次编辑于  2019-07-16
回答关注问题邀请回答
收藏

3 个回答

登录 后发表内容