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

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

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

touchesBegan: withEvent: / touchesMoved: withEvent: / touchesEnded: withEvent: 等只能被UIView捕獲(如有問(wèn)題請(qǐng)指出對(duì)請(qǐng)指出,路過(guò)的大牛請(qǐng)勿噴),當(dāng)我們創(chuàng)建

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

可以通過(guò)寫(xiě)UIScrollView 或 UIImageView 的category 重寫(xiě)touchesBegan: withEvent: / touchesMoved: withEvent: / touchesEnded: withEvent: 等來(lái)實(shí)現(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 




相關(guān)文章

最新評(píng)論

丽江市| 华坪县| 富民县| 原平市| 钟山县| 慈溪市| 敦化市| 洛扎县| 亳州市| 禄劝| 育儿| 安化县| 泽州县| 海盐县| 剑阁县| 康保县| 苍溪县| 潼南县| 张掖市| 万源市| 永川市| 云和县| 喀喇沁旗| 中宁县| 新乐市| 三穗县| 乐山市| 永嘉县| 邮箱| 潼关县| 道孚县| 博罗县| 泸州市| 汾西县| 双桥区| 寿阳县| 稻城县| 通榆县| 保康县| 临漳县| 平武县|