问题描述
单选框radio-group:
项目中使用单选框radio-group不想使用原来的样式,怎么自己自定义呢?
未修改前
解决方案:
修改完样式:
// 取消单选里面的边框线
/deep/.uni-list-cell::after {
background-color: #fff;
}
/deep/ radio .wx-radio-input{
border-radius: 50%;/* 圆角 */
width: 40rpx;
height: 40rpx;
border: none;
background: none;
position: absolute;
right: 0rpx;
}
/* 选中后的 背景样式 (红色背景 无边框 可根据UI需求自己修改) */
/deep/ radio .wx-radio-input.wx-radio-input-checked{
border: none !important;
background: none !important;
position: absolute;
right: 0rpx;
}
/* 选中后的 对勾样式 (白色对勾 可根据UI需求自己修改) */
/deep/ radio .wx-radio-input.wx-radio-input-checked::before{
line-height: 40rpx;
text-align: center;
font-size:38rpx; /* 对勾大小 30rpx */
color:#3290FF; /* 对勾颜色 白色 */
background: transparent;
transform:translate(-50%, -50%) scale(1);
-webkit-transform:translate(-50%, -50%) scale(1);
}
此篇文章如果对您有帮助的话,请给作者点个赞加个关注,谢谢观看!