一、按钮控件的使用
属性:
1.1 设置指定状态对应的标题文本
-(void)SetTitle:(NSString *)title
forState:(UIControlState)state;
1.2
设置指定状态对应的标题颜色
-(void)
S
etTitleColor:(UIColor *)color forState:(UIControlState)state;
1.3
设置指定状态对应的显示图片
-(void)
S
etImage:(UIImage *)image forState:(UIControlState)state;
1.4
设置指定状态对应的背景图片
-(void)
S
etBackground:(UIImage *)image forState:(UIControlState)state;
1.5
设置指定状态对应的
-(void)
addTarget
:(id)target action:(SEL)action for controlEvents:(UIcontrolEvents)controlEvents;
1.1 UIControlStateNormal;
//正常状态
1.2
UIControlStateHighlighte d; //高亮状态
1.3 UIControlStateDisabled; //禁用状态
1.4 UIControlStateSeleted; //选中状态
1、UIBunton
: 用户的点击事件
UIBuntton 的状态
事件处理
UIControlEventTouchDown
//按下触发
UIControlEventTouchDownR epeat //点击计数大于1触发
UIControlEventTouchDragI nside //触摸在控件内拖动触发
UIControlEventTouchDrago utside //触摸在控件外拖动触发
UIControlEventTouchEnter //触摸从控件之外拖到内部触发
UIControlEventTouchexit //触摸从控件之内拖到外部触发
UIControlEventTouchupins ide //控件之内触摸抬起
UIControlEventTouchupout side //控件之外触摸抬起
UIControlEventTouchcance l //触摸取消事件