panyh
panyh
  • 发布:2018-12-20 17:44
  • 更新:2019-10-22 15:22
  • 阅读:8337

uniapp checkbox的样式不同平台不同的显示,app端改不了样式

分类:uni-app

uniapp的checkbox标签属性直接设置不了,就使用.checkbox类,现在h5和小程序都能圆角白勾,app内为框蓝勾,改checkbox本身也不行
.checkbox .uni-checkbox-input{
border: 1px solid #9a9a9a;
border-radius: 50%;/ 圆角 /
width: 40rpx; / 背景的宽 /
height: 40rpx; / 背景的高 /
box-sizing:border-box;
}
/ 选中后的 背景样式 (红色背景 无边框 可根据UI需求自己修改) /
.checkbox .uni-checkbox-input.uni-checkbox-input-checked{
border: none;
background: #32953b;
}
/ 选中后的 对勾样式 (白色对勾 可根据UI需求自己修改) /
.checkbox .uni-checkbox-input.uni-checkbox-input-checked::before{
border-radius: 50%;/ 圆角 /
width: 40rpx;/ 选中后对勾大小,不要超过背景的尺寸 /
height: 40rpx;/ 选中后对勾大小,不要超过背景的尺寸 /
line-height: 40rpx;
text-align: center;
font-size: 24rpx; / 对勾大小 30rpx /
color:#fff; / 对勾颜色 白色 /
background: transparent;
transform:translate(-50%, -50%) scale(1);
-webkit-transform:translate(-50%, -50%) scale(1);
}

2018-12-20 17:44 负责人:无 分享
已邀请:
ytmffkdx

ytmffkdx

/ #ifdef APP-PLUS || MP-WEIXIN /
checkbox .wx-checkbox-input {
border-radius: 50%;
}

checkbox .wx-checkbox-input.wx-checkbox-input-checked {  
    border: 1px solid #ff4500;  
    background: #ff4500;  
    color: #fff !important;  
}  

checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {  
    font-size: 18px;  
}  

/* #endif */
  • 辰龙old

    谢谢啦

    2019-02-28 23:47

  • panyh (作者)

    已采纳,谢谢

    2019-03-06 21:42

  • 1***@163.com

    你好,那radio 标签的样式 如何改变呀 尤其是选中后的

    2019-06-08 11:41

  • 2***@qq.com

    为啥我的改的没有反应,用的uni的form组件

    2019-08-14 16:13

Trust

Trust - 少说废话

目前仅 H5 平台可以修改,App 平台后续会优化提供配置来处理。
小程序平台的,这个肯定是改不了,除非小程序平台开放配置。

  • panyh (作者)

    小程序可以改的,现在只有app不行

    2018-12-28 16:38

  • 喜欢技术的前端

    h5平台可以改吗??刚试了下,不行

    2019-03-27 16:40

3***@qq.com

3***@qq.com

啥时候能优化配置,最近想给input加letter-spacing,也加不上去。没法选择到input标签。

辰龙old

辰龙old

H5平台的也改不了

s***@126.com

s***@126.com

头条小程序的怎么样改,找不到呢

panyh

panyh (作者) - p

最终我用了分端处理

该问题目前已经被锁定, 无法添加新回复