UISwitch/开关
2015-07-07 17:17
274 查看
UISwitch/开关
1、开关按钮
UISwitch *sw=[[UISwitch alloc] initWithFrame:CGRectMake(100, 200, 50, 40)];
2、控制开关,YES是开,NO是关
sw.on=YES;
3、关闭状态下的颜色
sw.tintColor=[UIColor redColor];
4、开关按钮打开状态下的颜色
sw.onTintColor=[UIColor blackColor];
5、添加开关事件
sw addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:sw];
[sw release];
1、开关按钮
UISwitch *sw=[[UISwitch alloc] initWithFrame:CGRectMake(100, 200, 50, 40)];
2、控制开关,YES是开,NO是关
sw.on=YES;
3、关闭状态下的颜色
sw.tintColor=[UIColor redColor];
4、开关按钮打开状态下的颜色
sw.onTintColor=[UIColor blackColor];
5、添加开关事件
sw addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:sw];
[sw release];
相关文章推荐
- 黑马程序员---GUI图形化界面
- CMDBuild安装及webservice接口的获取
- LeetCode52:N-Queens II
- poj2593 Max Sequence(两个不相交字段的最大总和与)
- IOS - UIView添加点击事件
- angular+requirejs前端整合
- 《简约之上:交互设计四策略》
- easyui datagrid 列显示和隐藏
- UITableView 重用 UITableViewCell 并异步加载图片时会出现图片错乱的情况的原因
- UITableView 重用 UITableViewCell 并异步加载图片时会出现图片错乱的情况
- build
- Android UI 自动化测试
- java获取request中的各种路径
- 直播m3u8 参数#EXT-X-DISCONTINUITY
- 黑马程序员----论String,StringBuffer,StringBuilder,基本数据类型对象包装类
- MySQL 中文insert报错Incorrect string value: '\xCC\xEC\xB2\xC5'
- Leetcode Implement Queue using Stacks
- UINavigationController/导航控制器
- String、StringBuffer、StringBuilder主要区别及使用选择
- Hive 创建和生成Rcfile 和SequenceFile格式的表