UISwitch
2015-08-28 17:34
295 查看
UISwitch属性
1. onTintColor
处于on时switch 的颜色switchImage.onTintColor = [UIColor grayColor];
2.tintColor
处于off时switch 的颜色switchImage.tintColor = [UIColor greenColor];
3.onImage
设置on 的图标switchImage.onImage = [UIImage imageNamed:@"1.png"];
4. offImage
设置off的图标switchImage.offImage = [UIImage imageNamed:@"4.png"];
5. on
设置switch的开关swithImage.on = YES;
6.thumbTintColor
设置拇指颜色swithImage.thumbTintColor = [UIColor redColor];
效果:
7.增加事件响应机制
监听的是这个事件:UIControlEventValueChanged,值改变事件[switchImage addTarget:self action:@selector(switchOn) forControlEvents:UIControlEventValueChanged];
相关文章推荐
- UITextField
- UITextView
- UIView的layoutSubviews和drawRect方法何时调用
- UIPageControl
- UIPikerView
- UITableView上拉时崩溃问题及解决
- builder.properties
- UUID.randomUUID()
- UIAlertView基本用法详解和delegate方法调用
- easyUI的列表控件(datagrid)日期列不能正确显示的解决方法
- Django中的request和response
- UIScrollView
- java.lang.SecurityException: Requires VIBRATE permission
- iPhone开发之UIScrollView滚动组件的使用(四) 拖线实现 喜马拉雅案例
- POJ 2031 Building a Space Station
- java.lang.SecurityException: !@Too many alarms (500) registered from pid 10790 uid 10206
- 最火的UI快速开发框架androidannotations
- Ansj标准分词使用注意事项(MyStaticValue.isRealName属性)
- 【Material Design视觉设计语言】UI组件设计(十五):文本框
- uva 1152 4 Values whose Sum is 0(二分_中途相遇|| hash)