iOS---UISwitch控件
2015-12-19 13:00
316 查看
/** 声音 */
@property(nonatomic,strong)
UISwitch *soundSwitch;
cell.textLabel.text=@"声音";
[ _soundSwitch
addTarget: self
action:@selector(soundSwitch:)
forControlEvents:UIControlEventValueChanged];
_soundSwitch = [[UISwitch
alloc] init];
[_soundSwitch setOn:YES];
cell.accessoryView =
_soundSwitch;
/** ---------------------------------------------------------------------------*/
#pragma mark - 声音
- (void) soundSwitch:(id)sender{
UISwitch *switchButton = (UISwitch*)sender;
BOOL isButtonOn = [switchButton
isOn];
if (isButtonOn) {
NSLog(@"
打开 ");
}else {
NSLog(@"
关闭 ");
}
}
@property(nonatomic,strong)
UISwitch *soundSwitch;
cell.textLabel.text=@"声音";
[ _soundSwitch
addTarget: self
action:@selector(soundSwitch:)
forControlEvents:UIControlEventValueChanged];
_soundSwitch = [[UISwitch
alloc] init];
[_soundSwitch setOn:YES];
cell.accessoryView =
_soundSwitch;
/** ---------------------------------------------------------------------------*/
#pragma mark - 声音
- (void) soundSwitch:(id)sender{
UISwitch *switchButton = (UISwitch*)sender;
BOOL isButtonOn = [switchButton
isOn];
if (isButtonOn) {
NSLog(@"
打开 ");
}else {
NSLog(@"
关闭 ");
}
}
相关文章推荐
- POJ2778 DNA sequence
- Lipshitz Sequence Codeforces Round #333 (Div. 1) B(单调栈)
- iOS UILabel 设置行间距
- Arduino - 28BYJ-48步进电机+ULN2003驱动模块
- 小米手机如何刷开发版MIUI 小米4/小米Note稳定版升级开发版方法
- 打印 上一主题 下一主题 简单讲解UEFI及MBR,及UEFI系统安装引导修复
- UIDatePicker 时间滚动表
- SQLServer跨服务器访问数据库(openrowset/opendatasource/openquery)
- juery实现粘贴复制
- [IOS]轻松理解UITableViewCell的重用机制
- 308. Range Sum Query 2D - Mutable
- Android:Handler+Looper+MessageQueue+Thread(线程间的通信)随记
- 【Java学习笔记】String、StringBuffer和StringBuilder
- mysql update中使用subquery
- 【POJ 3709】K-Anonymous Sequence
- jenkins 安装 SVN Publisher 后向 svn 提交代码报错: E170001: Authentication required for...
- Query on a tree II
- 2016扁平化图标设计如何做太原UI设计师郭文军讲
- ERROR: Error installing rails: ERROR: Failed to build gem native extension.
- Leetcode: Implement Stack using Queues