给button增加点击事件时这个地方也加上了 UIControlEventTouchUpOutside 这个
2013-09-17 10:56
696 查看
self.typeButton = [UIButtonbuttonWithType:UIButtonTypeCustom];
self.typeButton.frame =self.bounds;
self.typeButton.showsTouchWhenHighlighted =YES;
self.typeButton.titleLabel.textAlignment =GNTextAlignmentCenter;
UIColor* color = [UIColorcolorWithRed:136.f/255.fgreen:90.f/255.fblue:31.f/255.falpha:1.0f];
[self.typeButtonsetTitleColor:color
forState:UIControlStateNormal];
self.typeButton.titleLabel.font = [UIFontsystemFontOfSize:10.0f];
self.typeButton.titleLabel.textAlignment =GNTextAlignmentCenter;
[self.typeButtonsetTitleEdgeInsets:UIEdgeInsetsMake(25.0f,
-19.0f,10.0f,0.0f)];
[self.typeButtonsetImageEdgeInsets:UIEdgeInsetsMake(4.0f,12.0f,
20.0f,12.0f)];
[self.typeButtonaddTarget:self
action:@selector(handleLandTipSelected:)
forControlEvents:UIControlEventTouchUpInside|UIControlEventTouchUpOutside];
[self addSubview:self.typeButton];
PS:查了下资料,UIControlEventTouchUpOutside 这个貌似是点击button后不放开,然后拖动到外面,接着才放开的事件
self.typeButton.frame =self.bounds;
self.typeButton.showsTouchWhenHighlighted =YES;
self.typeButton.titleLabel.textAlignment =GNTextAlignmentCenter;
UIColor* color = [UIColorcolorWithRed:136.f/255.fgreen:90.f/255.fblue:31.f/255.falpha:1.0f];
[self.typeButtonsetTitleColor:color
forState:UIControlStateNormal];
self.typeButton.titleLabel.font = [UIFontsystemFontOfSize:10.0f];
self.typeButton.titleLabel.textAlignment =GNTextAlignmentCenter;
[self.typeButtonsetTitleEdgeInsets:UIEdgeInsetsMake(25.0f,
-19.0f,10.0f,0.0f)];
[self.typeButtonsetImageEdgeInsets:UIEdgeInsetsMake(4.0f,12.0f,
20.0f,12.0f)];
[self.typeButtonaddTarget:self
action:@selector(handleLandTipSelected:)
forControlEvents:UIControlEventTouchUpInside|UIControlEventTouchUpOutside];
[self addSubview:self.typeButton];
PS:查了下资料,UIControlEventTouchUpOutside 这个貌似是点击button后不放开,然后拖动到外面,接着才放开的事件
相关文章推荐
- 在ib中为button 增加的action相应UIControlEventTouchUpInside 事件
- ScrollView上加Button UIControlEventTouchUpInside事件超出边界扔响应问题
- 首先是点击事件在不同的布局层次中传递的。 理解Down事件再哪个层次被消费(拦截),后续的Move、Up的点击事件如何传递。 其中ViewGroup中onInterceptTouchEvent方法
- Extjs grid column里添加button等html标签,并增加点击事件
- 第15天 Android Touch事件学习 2 触发点击事件的地方
- cocos2d JS touch屏幕点击事件监听 cc.EventListener.TOUCH
- cocos2d JS touch屏幕点击事件监听 cc.EventListener.TOUCH
- 一个button,一个手势+一个事件(touchupinside)
- UITableView增加自定义Button并绑定点击事件
- 安卓给button增加点击事件
- touchstart, touchmove, touchend, mousedown, mousemove, mouseup, 手机端和pc端点击及触摸事件
- Android点击事件onTouchEvent与onInterceptTouchEvent传递关系-只需要理解5点
- android 点击事件触发机制dispatchTouchEvent、onInterceptTouchEvent、onTouchEvent
- 关于listview重写onintercepttouchevent不响应move和up事件
- 重写dispatchTouchEvent方法,实现EditText失去焦点后(点击其他地方)收起键盘的效果
- android 事件分发 点击事件 ondispathTouchEvent onTouchEvent onInterceptTouchEvent
- ios5.1 UITapGestureRecognizer UIControlEventTouchUpInside
- Extjs grid column里添加button等html标签,并增加点击事件
- Button点击事件
- tableHeaderView中的button点击事件不响应