将UIScrollView点击点击事件传递到父View
2016-02-24 16:15
239 查看
直接上代码:
#import <UIKit/UIKit.h>
@interface CTScrollView :
UIScrollView
@end
#import "CTScrollView.h"
@implementation CTScrollView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[[self
nextResponder] touchesBegan:touches
withEvent:event];
[super touchesBegan:touches
withEvent:event];
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
[[self
nextResponder] touchesMoved:touches
withEvent:event];
[super touchesMoved:touches
withEvent:event];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[[self
nextResponder] touchesEnded:touches
withEvent:event];
[super touchesEnded:touches
withEvent:event];
}
@end
#import <UIKit/UIKit.h>
@interface CTScrollView :
UIScrollView
@end
#import "CTScrollView.h"
@implementation CTScrollView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[[self
nextResponder] touchesBegan:touches
withEvent:event];
[super touchesBegan:touches
withEvent:event];
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
[[self
nextResponder] touchesMoved:touches
withEvent:event];
[super touchesMoved:touches
withEvent:event];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[[self
nextResponder] touchesEnded:touches
withEvent:event];
[super touchesEnded:touches
withEvent:event];
}
@end
相关文章推荐
- PagerSlidingTabStrip嵌套PagerSlidingTabStrip的Touch事件冲突解决
- View的事件体系
- 自定义控件,touch事件传递
- Fuel SSH访问控制节点的方法
- 怎样可以sign GVS的build
- Animation动画详解(六)——ValueAnimator高级进阶(二)
- UISearchController的基本使用
- ubuntu error: SSL modules require the OpenSSL library.
- UITabBarController--选项卡栏控制器
- 为何Math.abs(Integer.MIN_VALUE) = Integer.MIN_VALUE
- UITextField限制输入长度
- iOS 3D UI(3D翻转)
- 通过xib加载UITableViewCell的新方式
- 为Openstack创建实例(对fuel原生部分的修订)
- LeetCode -- Longest Increasing Subsequence(LIS)
- GUID 类型
- sdut 2428 Ubiquitous Religions(最小生成树)
- UIActivityViewController 系统社交化 共享
- dom4j解析xml报错:Nested exception: org.xml.sax.SAXParseException: White space is required between the processing instruction target and data.
- 使用easyui实现双击列表中某个值直接对其进行修改