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;
相关文章
- UISwitch(开关控件)、UISegmentedControl(分段控件)
- iphone/ipad实现自定义的开关UISwitch(continuous,clipsToBounds,userInteractionEnabled属性)
- UI:tomcat(说话小程序)、相框动画、UISgmentcontrol、UISwitch
- iOS通过UISwitch控制摇一摇
- UI----安健2 UIswitch UIslider
- 学习iOS开关按钮UISwitch控件
- 如何禁用UISwitch?
- 详解iOS App中UISwitch开关组件的基本创建及使用方法
- swift 实践- 07 -- UISwitch 开关
- UISwitch 开关控件