UISwitch

来源:互联网 发布:c语言冒泡排序简单代码 编辑:程序博客网 时间:2024/06/04 19:11

UISwitch开关按钮
UISwitch *swich =[[UISwitch alloc]initWithFrame:CGRectMake(20, 300, 40, 40)];//frame是没有意义的,系统的开关控件大小是确定的。
swich.onImage= [UIImage imageNamed:@”switchTwo_on.png”];//不能使用,无效
swich.onTintColor=[UIColor clearColor];//开关打开时的颜色
swich.tintColor=[UIColor blackColor];//开关的边框颜色
swich.thumbTintColor=[UIColor redColor];//开关的颜色
switch.on=yes;//设置开关的状态

手动设置开关状态
- (void)setOn:(BOOL)on animated:(BOOL)animated;

0 0
原创粉丝点击