小程序_改变switch组件的大小

微信开发文档中,switch能修改颜色,没有直接修改switch大小的属性。用一般控件height & width来修改宽高是没有用的。

使用如下方法:

在.wxss文件:

.wx-switch-input {
   42px !important;
  height: 20px !important;
}

.wx-switch-input::before {
   41px !important;
  height: 20px !important;
}

.wx-switch-input::after {
   18px !important;
  height: 18px !important;
}
原文地址:https://www.cnblogs.com/wush-1215/p/9533811.html