微信开发文档中,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; }