码迷,mamicode.com
首页 > 移动开发 > 详细

ios控件 UIControl

时间:2015-01-08 21:35:50      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:

《 UIControl》

1 处理用户事件的控件的基类,如UIButtonUISlider等
2 一般不直接实例化,而是使用他的子类
3 可以通过跟踪触摸事件来设置和获取控件状态,并且这些方法可以被子类继承
 
//添加一个事件
- (void)addTarget:(id)target action:(SEL)action forControlEvents: (UIControlEvents)controlEvents;

//移除一个事件
- (void)removeTarget:(id)target action:(SEL)action forControlEvents: (UIControlEvents)controlEvents;

 

 

 UIControlEventTouchDown //用户按下时触发
UIControlEventTouchDownRepeat //用户按下多次是触发
UIControlEventTouchDragInside //在控件内拖动是触发
UIControlEventTouchDragOutside //在控件外拖动时触发
UIControlEventTouchDragEnter //从控件外拖到控件内时触发
UIControlEventTouchDragExit //从控件内拖到控件外时触发
UIControlEventTouchUpInside //在控件内按下并松开时触发
UIControlEventTouchUpOutside //控件外松开时触发
UIControlEventTouchCancel //触摸被取消 设备上锁或电话打断时触发

 

=1<<0, =1<<1, =1<<2, =1<<3, =1<<4, =1<<5, =1<<6, =1<<7, =1<<8,

 

 

UIControlEventValueChanged //控件的值发生改变时触发
UIControlEventEditingDidBegin //文本控件开始编辑时触发
UIControlEventEditingChanged //文本控件中的文字被改变后触发
UIControlEventEditingDidEnd //文本控件结束编辑时触发
UIControlEventEditingDidEndOnExit = 1 << 19, //文本控件按回车时触发

 

UIControlEventAllTouchEvents = 0x00000FFF, //所有触摸事件

UIControlEventAllEditingEvents = 0x000F0000, UIControlEventApplicationReserved = 0x0F000000, UIControlEventSystemReserved = 0xF0000000, //所有文本编辑事件

UIControlEventAllEvents           = 0xFFFFFFFF//所有事件
UIControlStateNormal = 0, //正常状态
UIControlStateHighlighted = 1 << 0, //高亮状态
UIControlStateDisabled = 1 << 1, //禁用状态
UIControlStateSelected = 1 <<
//选中状态

 


 

 

 

 

 

ios控件 UIControl

标签:

原文地址:http://www.cnblogs.com/daijiahong/p/4211855.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!