YStudio Y++

YSS · 开关(switch)

Y++ / YStudio 开发文档 · 一点滴

选择器: switch · 设计器组件: 开关 · 按名称: switch#名称#名称

伪状态: :checked(开启) :off(关闭)

可用属性

属性 说明
background-color 关闭时轨道色
thumb-color 滑块圆点颜色
color 标签文字
border-radius 轨道圆角
font-size 字体

:checked 块中 background-color 映射为开启轨道色(backColor2)。

示例

switch#开关1 {
    background-color: #4A4A50;
    thumb-color: #FFFFFF;
    border-radius: 14;
}
switch#开关1:checked {
    background-color: #9B6FD0;
}