UISwitch
2016-03-08 16:36
381 查看
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];
声明:这是之前朋友的资料,可能比较旧,在此仅仅做个人备份,大家参考看,如果涉及侵权了联系我删除。
相关文章推荐
- 在EasyUI的DataGrid中嵌入Combobox
- UIView
- 133.Which two statements are true regarding subqueries? (Choose two.)
- UIView如何管理它的子视图
- request.getSession(true)和request.getSession(false)的区别
- ios CALayer Core Animation UIView动画封装
- Android studio通过选择不同的Build Variant执行不同的groovy代码
- UGUI 3d坐标转UI坐标
- Ueditor使用以及遇到的问题
- iOS开发--轮播图(无限循环)新玩法--视差轮播--无限循环的新思路(两个UIImageView足矣)
- 广搜 — — ZOJ 1649 Rescue
- data-options的移除验证(easyui validatebox中移除验证)
- AndroidStudio导入项目一直卡在Building gradle project info最快速解决方案
- C#中三层架构UI、BLL、DAL、Model实际操作
- iframe页面改动parent页面的隐藏input部件value值,不能触发change事件。
- chrome显示ue-editor上传的视频问题
- ORA-02266: unique/primary keys in table referenced by enabled foreign keys
- ANDROID L - Material Design详解(UI控件)
- No mapping found for HTTP request with URI [/exam3/welcome] in DispatcherServlet
- media query ie8- 兼容实现总结