子钦加油

扩大
缩小

微信小程序switch样式调整

修改方案一:

参考:https://blog.csdn.net/littlebeargreat/article/details/79130305

/*swtich整体大小*/
.wx-switch-input{
width:82rpx !important;
height:40rpx !important;
}
/*白色样式(false的样式)*/
.wx-switch-input::before{
width:80rpx !important;
height: 36rpx !important;
}
/*绿色样式(true的样式)*/
.wx-switch-input::after{
width: 40rpx !important;
height: 36rpx !important;
}

 

修改成功,如果要完全调整和Ui图一样比较难控制,类似这样:开关打开,白色部分超出显示,各种问题

 

 

修改方案二:

用zoom属性修改 ,zoom的值越大,switch越大   1是原大小,1-0.1成倍缩小    1-...   成倍放大    可以自己试试,找个适合的尺寸

switch_default_address {

zoom: .4;

}

 

 

posted on 2019-12-26 12:46  子钦加油  阅读(3049)  评论(0编辑  收藏  举报

导航

返回顶部