UISwitch
来源:互联网 发布:cs1.6弹道优化本地 编辑:程序博客网 时间:2024/05/05 22:39
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UISwitch *switchTest =[[UISwitch alloc] initWithFrame:CGRectMake(100, 100, 50, 30)];
switchTest.tag = 10;
// [switchTest setOn:YES]; //设置开状态
[switchTest setOn:YES animated:NO];
}
-(void)doTest
{
// UISwitch* control = (UISwitch*)sender;
UISwitch *control = (UISwitch*)[self.view viewWithTag:10];
if (control.on) {
NSLog(@"++++ON");
}
else {
NSLog(@"++++OFF");
}
}
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UISwitch *switchTest =[[UISwitch alloc] initWithFrame:CGRectMake(100, 100, 50, 30)];
switchTest.tag = 10;
// [switchTest setOn:YES]; //设置开状态
[switchTest setOn:YES animated:NO];
[switchTest addTarget:self action:@selector(doTest) forControlEvents:UIControlEventValueChanged];
}
-(void)doTest
{
// UISwitch* control = (UISwitch*)sender;
UISwitch *control = (UISwitch*)[self.view viewWithTag:10];
if (control.on) {
NSLog(@"++++ON");
}
else {
NSLog(@"++++OFF");
}
}
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- UISwitch
- three.js使用二:修复three.js的纹理路径多一个\的问题
- WebBrowser:在Windows7下编辑模式失效
- 【最长公共子序列】杭电 HDU 1423 Greatest Common Increasing Subsequence
- Ogre 引擎四元数与三维向量相乘算法推导
- OK6410 嵌入式开发板无线网卡USB RT3070移植笔记
- UISwitch
- 【Android】状态栏通知Notification、NotificationManager详解
- VOIP电话系统的开发思路
- jQuery Ajax全解析
- 这样去写你的 HTML
- DSkinLite学习
- webkit里会出现突然闪一下的问题
- Android游戏引擎之LibGdx介绍及各模块概述
- Debian5 下安装 Asterisk 1.6