ios UIScrollView不能响应TouchesBegin:的事件的解决办法

1:@property MyScrollView *scrollView;

2:给MyScrollView,增加类别:MyScrollView+Touch

3:在类别里实现下面三个方法:

@implementation MyScrollView (Touch)

- (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

4:- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{

[self hiddenkeyBoard];

}

时间: 2024-08-11 03:25:23

ios UIScrollView不能响应TouchesBegin:的事件的解决办法的相关文章

IOS UIImageView直接响应点击事件的解决方法

UIImageView的手势处理可以响应点击事件. 1.  self.allScreenImg.userInteractionEnabled = YES;//UIImageView默认不响应手势,需要开启userInteractionEnabled //处理单击事件 UITapGestureRecognizer* singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(clickAllScr

FileSystemWatcher触发多次Change事件的解决办法

(转) 最近要用到FileSystemWatcher来监控某个目录中的文件是否发生改变,如果改变就执行相应的操作(具体操作如:打开文档,添加一行,保存).但在开发过程中,发现FileSystemWatcher在文件创建或修改后,会触发多个Created或Changed事件,具体原因就是处理文件的过程中执行了多次文件系统操作,触发了多次事件.具体可以参看微软的关于FileSystemWatcher这方面的解释:Troubleshooting FileSystemWatcher Components

双击事件失效解决办法

某些时候,双击事件会失效,模拟办法解决双击失效后,而同时我又不想在该元素上触发两次单击事件,解决办法如下: var dbclickTime={ prev:0, next:0//模拟触发双击};var clickConflict={//解决单击事件和双击事件的冲突 _timeout:null, set:function (fn) { this.clear(); this._timeout=window.setTimeout(fn,400); }, clear:function () { if(th

DELPHI XE5 UP2 运行IOS 遇到 Wrapper init failed: (null)问题的解决办法

一.问题表现: 在MAC OSX(10.9.2)上安装了比较新的XCODE5.1 和COMMAND LINE TOOLS 在DELPHI XE5 UP2上放了一个按钮,输出到MAC OSX上,出现: Wrapper init failed: (null) 查看了很多大侠的博客. 二.问题的其他表现在Embarcadero的论坛上找到: 原文位置:https://forums.embarcadero.com/thread.jspa?threadID=101749&tstart=0 What doe

iOS UIScrollView不能响应TouchBegin事件的处理方法:

原因:UIView的Touch事件被UIScrollview捕获了,所以UIView里面的Touch事件没有响应——————解决方法:将UIScrollview的捕获的Touch事件往上传:————给UIScrollview添加类别:UIScrollView+UITouch.h 代码: #import "UIScrollView+UITouch.h" @implementation UIScrollView (UITouch) -(void)touchesBegan:(NSSet<

Mint-ui中loadmore(上拉加载下拉刷新)组件在ios中滑动会触发点击事件的解决方法

bug说明: Mint-ui中loadmore(上拉加载下拉刷新)组件 在 使用fastclick的情况下 ,在ios设备中滑动会触发点击事件: 解决方法: 我是按需引入,去项目中找到loadmore下的index.js,全部引入的要找mint下面mint-ui.common.js 路径如下:你的项目名/node_modules\mint-ui\lib\loadmore\index.js 搜索 handleTouchEnd ,记得写event进去 handleTouchEnd: function

C#发送邮件时提示:“不允许使用邮箱名称。服务器响应为:”的错误解决办法

由于项目需要,要为客户提供一个定期发送邮件的程序.本来原来自己还写过,但新写的程序一晚上也没通过测试,总是提示"不允许使用邮箱名称.服务器响应为..." 经过在网上搜索查找解决办法,似乎解决办法都是一个,就是把smtp.UseDefaultCredentials = true;写到smtp.Credentials = new NetworkCredential("myusername", "mypwd");的前面. 但使用此方法,也未能解决问题.

[Phonegap+Sencha Touch] 移动开发16 安卓webview中,input输入框不触发backspace回退键事件的解决办法

可以用安卓手机浏览器打开 http://javascript.info/tutorial/keyboard-events#test-stand-test-stand 测试看看. Android 4.2自带浏览器和webview的测试结果(其他版本没试过,估计4.X都是这样): 当input有内容的时候,点击软键盘回退键(keyCode=8),是有keyEvents事件(keyup keydown)触发的:当input是空的时候,再点击,就不触发keyEvents了. Chrome浏览器测试结果:

JS事件冒泡解决办法

<div id="div1"> <div id="div2"> <input type="button" value="按钮"/> </div> </div> $(function(){ $("div1").click(function(){ alert("DIV1"); }); $("div2").clic