iOS开发中touchesBegan和touchesEn…
来源:互联网 发布:域名备案账号忘记 编辑:程序博客网 时间:2024/05/22 02:19
touchesBegan跟touchedEnd沒有提供給UIScrollViewDelegate
所以要自己建立一個繼承自UIScrollView的class
重寫這兩個method
myScrollView.h
@interface myScrollView : UIScrollView
@end
myScrollView.m
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
[super touchesBegan:touches withEvent:event];
if ( !self.dragging )
{
[[self nextResponder] touchesBegan:touches withEvent:event];
}
}
-(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
[super touchesEnded:touches withEvent:event];
if ( !self.dragging )
{
[[self nextResponder] touchesEnded:touches withEvent:event];
}
}
之後建立UIScrollView就是用myScrollView建立即可使用這兩個method
myScrollView *contentScrollView = [[myScrollView alloc] init];
0 0
- iOS开发中touchesBegan和touchesEn…
- ios-tableView的touchesBegan事件和didSelectRowAtIndexPath方法
- iOS 用UIScrollView不能获取到touchesBegan
- iOS事件机制,以及不同手势使用touchesBegan等表现形式
- 在UITableviewController中touchesBegan:withEvent:无响应问题
- IOS开发-工程中蓝色文件夹和黄色文…
- iOS开发中#include 和#import
- iOS 开发中常用知识点和技巧
- iOS开发中self和super
- ios开发中地图和定位
- iOS开发中属性 property 和 synthesize
- IOS开发中 retain 和 strong 区别
- iOS 开发中ARC和MRC 混合开发
- iOS开发中Swift和Objecttive-C的混合开发
- ios-ScrollView添加到view上,view的touchesBegan无法执行
- iOS开发中iOS小结
- iOS开发:xcode4中使用静态库和工作区
- iOS开发:xcode4中使用静态库和工作区
- Java_final,finally,finalize
- Android Bitmap详细介绍
- 避免滑动tableView时对NSTimer的干…
- 视图控制对象生命周期-init、viewD…
- CP vs SP
- iOS开发中touchesBegan和touchesEn…
- UIScrollViewDelegate
- 网站图片视频等防盗链
- Java_对象初始化
- 有时UIGestureRecognizer手势识别…
- iOS避免内存警告的一些建议
- ios7 隐藏状态栏
- Java_this
- UINavigationController