定制了的导航栏,如何显示加载中指示器?
发布于 6 年前 作者 hufang 14866 次浏览 来自 官方Issues

在 navigationStyle=default 时,可以通过调用 wx.showNavigationBarLoading(Object object) 来在标题左侧显示一个加载中的指示器,当设置了 navigationStyle=custom 时,如何让 wx.showNavigationBarLoading(Object object) 也有效。

也就是说,在定制导航栏时,要如何编写导航代码也能达到调用 wx.showNavigationBarLoading(Object object) 时在标题左侧显示一个加载中的指示器。

2 回复

可以自己重写wx.showNavigationBarLoading 和 wx.hideNavigationBarLoading

让其兼容原生导航和自定义导航

https://developers.weixin.qq.com/community/develop/article/doc/000caac50f4a38351f19596b35c813

可以看这个例子里的代码片段,或者直接点这个 => 代码片段

在开发工具中运行代码片段,然后点击“原生导航”按钮

自己写,放一个加载中,控制显示隐藏。

回到顶部