微信小程序动态设置下拉背景字体 loading图的样式方法

追格官方小助手/ 2022年11月26日/ 小程序/ 浏览 1885

微信小程序wx.setBackgroundTextStyle(Object object) 接口,主要用于动态设置下拉背景字体 loading图的样式。


根据微信文档的介绍,小程序基础库版本不能低于 2.4.0。


示例代码:


wx.setBackgroundTextStyle({
  textStyle: 'dark' // 下拉背景字体、loading 图的样式为dark
})


属性:textStyle

类型:string

合法值:dark、dark 样式

合法值:light、light 样式


若想动态设置窗口的背景色可以使用wx.setBackgroundColor(Object object)接口


示例代码:


wx.setBackgroundColor({
  backgroundColor: '#ffffff', // 窗口的背景色为白色
})

wx.setBackgroundColor({
  backgroundColorTop: '#ffffff', // 顶部窗口的背景色为白色
  backgroundColorBottom: '#ffffff', // 底部窗口的背景色为白色
})

发表评论

暂无评论,抢个沙发...

客服 工单