微信小程序switch样式调整

时间:2019-12-26 13:21:04   收藏:0   阅读:1117

修改方案一:

参考: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;

}

 

 

原文:https://www.cnblogs.com/zmdComeOn/p/12101433.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!