开发者

Method didn't work in UIScrollView

hello i put some uitextfield in uiscrollview,and connect the开发者_Python百科m in interface builder to event "touch down" to a method,the problem his that when the uitexttfield is inside uiscrollview the method doesn't called and when the textfield is not in the uiscroll view the method doesn't called.


UIScrollView is special because of all the touch events it needs to process itself. Try sub-classing UIScrollView and add:

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {  
   NSLog(@"you should see this for touch events on your scroll view");
}

set the class name in IB to your UIScrollView subclass.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜