UISwitch
来源:互联网 发布:xp网络共享一键设置 编辑:程序博客网 时间:2024/06/08 09:50
UISwitch控件
UISwitch *infoSwitch = [[UISwitch alloc]initWithFrame:CGRectMake(20 , 200 , 20, 10)];
[infoSwitch setOn:YES];[infoSwitch addTarget:self action:@selector(switchClick:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:infoSwitch];
- (void)switchClick: (UISwitch *)sender {
UISwitch *buttonSwitch = (UISwitch *)sender;
BOOL isSwitchOn = buttonSwitch.isOn;
if (isSwitchOn) {
///what to do...
NSLog(@"open");
}else {
///what to do...
NSLog(@"close");
}
}
0 0
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- 关于Linux连接Oracle数据库报错Caused by: java.sql.SQLRecoverableException: IO Error: Connection timed out的解决方案
- 反转输出字符串
- laravel之Qiniu
- iOS推送
- GoogleAPI Adwords Budget
- UISwitch
- UILabel 调整行间距
- 字符串大小写转换(三种方法)
- java.lang.OutOfMemoryError: Java heap space
- linux非阻塞的socket EAGAIN的错误处理
- CodeForces 615A Bulbs
- Android 第四天(晚上)
- 通过Excel批量生成对应的SQL语句
- Resource temporarily unavailable,errno代码为11(EAGAIN)