最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

touchesBegan: withEvent: 不執(zhí)行解決

 更新時間:2016年12月23日 15:03:07   投稿:lqh  
這篇文章主要介紹了touchesBegan: withEvent: 不執(zhí)行解決的相關資料,需要的朋友可以參考下

touchesBegan: withEvent: / touchesMoved: withEvent: / touchesEnded: withEvent: 等只能被UIView捕獲(如有問題請指出對請指出,路過的大牛請勿噴),當我們創(chuàng)建

UIScrollView UIImageView 時,當點擊時UIScrollView UIImageView 會截獲touch事件,導致touchesBegan: withEvent:/touchesMoved: withEvent:/touchesEnded: withEvent: 等方法不執(zhí)行。解決辦法:當UIScrollView 或 UIImageView 截獲touch事件后,讓其傳遞下去即可(就是傳遞給其父視圖UIView)

可以通過寫UIScrollView 或 UIImageView 的category 重寫touchesBegan: withEvent: / touchesMoved: withEvent: / touchesEnded: withEvent: 等來實現(xiàn)

// 
// UIScrollView+UITouch.m 
//  
// 
// Created by MLS on 15/11/20. 
// Copyright © 2015年 mls. All rights reserved. 
// 
 
#import "UIScrollView+UITouch.h" 
 
@implementation UIScrollView (UITouch) 
 
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event 
{ 
  // 選其一即可 
  [super touchesBegan:touches withEvent:event]; 
//  [[self nextResponder] touchesBegan:touches withEvent:event]; 
} 
 
@end 




相關文章

最新評論

中超| 平安县| 巴马| 西乡县| 大庆市| 讷河市| 曲周县| 顺平县| 玉龙| 聊城市| 黑龙江省| 博罗县| 宽城| 博罗县| 烟台市| 锦州市| 邢台市| 罗江县| 海淀区| 黎城县| 公主岭市| 北海市| 拉萨市| 新巴尔虎右旗| 江门市| 小金县| 东城区| 读书| 夏邑县| 中山市| 阳江市| 中牟县| 明溪县| 庆安县| 台安县| 玉田县| 安岳县| 绵竹市| 利川市| 昭苏县| 甘谷县|