UISwitch

        UISwitch *noticeSwtich = [[UISwitch alloc] initWithFrame:CGRectMake(0, 0, 51, 31)];
//        noticeSwtich.layer.cornerRadius = noticeSwtich.height/2;
//        noticeSwtich.backgroundColor = RGB(0, 187, 39);
//        noticeSwtich.tintColor = RGB(0, 187, 39);//设置关着的时候的颜色
        noticeSwtich.onTintColor = RGB(0, 187, 39);//设置开着的时候的颜色
        [noticeSwtich addTarget:self action:@selector(noticeSwitchAction:) forControlEvents:UIControlEventValueChanged];
        cell.accessoryView = noticeSwtich;

 

posted @ 2015-01-22 19:35  shidaying  阅读(173)  评论(0编辑  收藏  举报