区分Sencha Touch 1.1中Radiofield和Checkbox字段的外观

时间:2012-01-17 04:35:56

标签: sencha-touch

默认情况下,Sencha Touch 1.1提供radiofieldcheckboxfield,其中显示复选标记(勾选)。由于这种设计,没有可视方式来区分它们。

Sencha Touch radiofield

如何更改radiofield的外观,使其看起来像传统的单选按钮?

2 个答案:

答案 0 :(得分:2)

我添加了自己的样式来更改复选框的外观。

.x-field .x-input-radio:after, .x-field .x-input-radio:checked:after {
    content: "";
    position: absolute;
    width: 1.25em;
    height: 1.25em;
    top: 50%;
    left: auto;
    -webkit-transform: rotate(0deg) skew(0deg);
    -webkit-transform-origin: 50% 50%;
    -webkit-border-radius: 2em;
    right: 1.1em;
    border: .45em solid;
    margin-top: -0.75em;
}
.x-field .x-input-radio:checked:after {
    border-color: #06346a;
}
.x-field .x-input-radio:after {
    border-color: #dddddd;
}

答案 1 :(得分:0)

.x-field .x-input-radio:after,
.x-field.x-item-disabled .x-input-radio:checked:after {
    content: "";
    position: absolute;
    width: 1.4em;
    height: 1.4em;
    top: 50%;
    left: auto;
    right: 1.1em;
    -webkit-mask-image: url();
    margin-top: -0.7em;
    border-radius: 15px;
}
.x-field .x-input-radio:checked:after {
    content: "";
    position: absolute;
    top: 50%;
    left: auto;
    right: 1.1em;
    -webkit-mask-image: url();
    margin-top: -0.7em;
    border: 5px solid #dddddd;
    border-radius: 15px;
}

链接:http://tjwebb.wordpress.com/2012/03/24/how-to-override-the-default-sencha-touch-2-radio-field-style/