uiscrollview uicollectionview touch事件传递问题
2015-06-16 12:06
471 查看
uiscrollview uicollectionview 无法响应touch事件,解决方案,新建一个uiscrollview 的category
@implementation UIScrollView (UITouch)
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
//if(!self.dragging)
{
[[self nextResponder] touchesBegan:touches withEvent:event];
}
[super touchesBegan:touches withEvent:event];
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
//if(!self.dragging)
{
[[self nextResponder] touchesMoved:touches withEvent:event];
}
[super touchesMoved:touches withEvent:event];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
//if(!self.dragging)
{
[[self nextResponder] touchesEnded:touches withEvent:event];
}
[super touchesEnded:touches withEvent:event];
}
@end
uicollectionview 是继承uiscrollview,所以 也可以用此category,来截获touch事件
@implementation UIScrollView (UITouch)
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
//if(!self.dragging)
{
[[self nextResponder] touchesBegan:touches withEvent:event];
}
[super touchesBegan:touches withEvent:event];
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
//if(!self.dragging)
{
[[self nextResponder] touchesMoved:touches withEvent:event];
}
[super touchesMoved:touches withEvent:event];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
//if(!self.dragging)
{
[[self nextResponder] touchesEnded:touches withEvent:event];
}
[super touchesEnded:touches withEvent:event];
}
@end
uicollectionview 是继承uiscrollview,所以 也可以用此category,来截获touch事件
相关文章推荐
- Qt数据库 QSqlQueryModel实例操作 上下篇
- hadoop 的job.setOutputKeyClass和job.setOutputValueClass的几个问题
- 解决“Dynamic Web Module 3.0 requires Java 1.6 or newer.”错误
- UITabBarController与UINavigationController配合使用
- 114自定义UITableViewCell(扩展知识:为UITableViewCell添加动画效果)
- Axure制作手机UI原型之界面滑动滚动效果
- UE4教程&论坛
- 多线程之-NSOperationQueue
- UI之单例模式
- web.xml中dispatcher标签详解
- (转)通过Chisel加强LLDB的UI调试能力
- 如何使用NSOperations和NSOperationQueues
- 【EasyUI学习-3】Easyui tabs入门实践
- Implement Stack using Queues
- 常用设备类别及其GUID
- IOS UIScrollView中 使用 touch 无法响应的问题
- IOS Key-Value Observing (KVO)
- IOS Key-Value Observing (KVO)
- 【Android UI设计与开发】第09期:底部菜单栏(四)Fragment+PopupWindow仿QQ空间最新版底部菜单栏
- 【uiautomator】UiDevice