小程序_改變switch組件的大小


微信開發文檔中,switch能修改顏色,沒有直接修改switch大小的屬性。用一般控件height & width來修改寬高是沒有用的。

 

使用如下方法:

在.wxss文件:

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

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

.wx-switch-input::after {
  width: 18px !important;
  height: 18px !important;
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM