1. 大小

/* swtich整体大小 */
.wx-switch-input{
  width: 100rpx !important;
  height: 57rpx !important;
}
/* false的样式 */
.wx-switch-input::before{
  width: 100rpx !important;
  height: 53rpx !important;
}
/* true的样式 */
.wx-switch-input::after{
  width: 57rpx !important;
  height: 53rpx !important;
}

以上尺寸根据你的具体情况来调整

 

2. 颜色

<switch checked bindchange="switch1Change" color="#26a2ff" />

其实switch组件是有一个color属性的,估计除了我之外还有好多人没留意到的,你中枪了吗?

微信小程序 switch组件修改样式(大小,颜色)

相关文章:

  • 2021-11-04
  • 2022-02-11
  • 2022-01-01
  • 2021-11-17
  • 2021-07-19
  • 2021-05-28
  • 2021-12-03
  • 2022-01-01
猜你喜欢
  • 2022-02-11
  • 2021-11-02
  • 2021-08-03
  • 2021-07-25
  • 2021-12-07
  • 2021-12-17
  • 2021-12-23
相关资源
相似解决方案