久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

用于 UIScrollView 的 iOS5 UITapRecognizer 干擾按鈕.怎么

iOS5 UITapRecognizer for UIScrollView interfering with buttons. How to fix?(用于 UIScrollView 的 iOS5 UITapRecognizer 干擾按鈕.怎么修?)
本文介紹了用于 UIScrollView 的 iOS5 UITapRecognizer 干擾按鈕.怎么修?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我在 UIScrollView 中的 UIView 中有一堆 UIButton.我正在嘗試將點擊識別器添加到滾動視圖.點擊識別器觸發(fā),但現(xiàn)在我的按鈕都不起作用.

I have a bunch of UIButtons within a UIView within a UIScrollView. I'm trying to add a tap recognizer to the scroll view. The tap recognizer fires, but now none of my buttons work.

我知道在 iOS5 中,UIScrollView 可以在完成后以某種方式將觸摸事件向下傳遞到控件層次結(jié)構(gòu).任何人都可以幫我弄清楚如何做到這一點?

I know that in iOS5, UIScrollView can somehow pass a touch event down to the control hierarchy after being done with it. Anyone can help me figure out how to do this?

推薦答案

設(shè)置UIGestureRecognizer屬性cancelsTouchesInView為NO.

UITapGestureRecognizer *singleTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self 
                                                                                             action:@selector(singleTap:)];
singleTapGestureRecognizer.numberOfTapsRequired = 1;
singleTapGestureRecognizer.enabled = YES;
singleTapGestureRecognizer.cancelsTouchesInView = NO;
[tapableView addGestureRecognizer:singleTapGestureRecognizer];
[singleTapGestureRecognizer release];

來自 UIGestureRecognizer 類參考

影響是否觸摸的布爾值當(dāng)手勢被識別時傳遞到視圖.

A Boolean value affecting whether touches are delivered to a view when a gesture is recognized.

當(dāng)此屬性為 YES(默認值)并且接收者識別其手勢,該手勢的觸摸是未交付的未交付到視圖和之前交付的觸摸通過 touchesCancelled:withEvent: 消息被取消發(fā)送到風(fēng)景.如果手勢識別器無法識別其手勢,或者如果此屬性的值為 NO,視圖接收所有觸摸多點觸控序列.

When this property is YES (the default) and the receiver recognizes its gesture, the touches of that gesture that are pending are not delivered to the view and previously delivered touches are cancelled through a touchesCancelled:withEvent: message sent to the view. If a gesture recognizer doesn’t recognize its gesture or if the value of this property is NO, the view receives all touches in the multi-touch sequence.

這篇關(guān)于用于 UIScrollView 的 iOS5 UITapRecognizer 干擾按鈕.怎么修?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

UIButtons at the bottom of UIScrollView not working(UIScrollView 底部的 UIButtons 不起作用)
scrollViewWillEndDragging:withVelocity:targetContentOffset: not working on the edges of a UISCrollView(scrollViewWillEndDragging:withVelocity:targetContentOffset: 不在 UISCrollView 的邊緣工作) - IT屋-程序員軟件開發(fā)技術(shù)分享社
ImageView Scaling when scrolling down(向下滾動時 ImageView 縮放)
Bounds automatically changes on UIScrollView with content insets(UIScrollView 上的邊界自動更改,帶有內(nèi)容插圖)
Handling scroll views with (custom, interactive) view controller presentation and dismissal(使用(自定義、交互式)視圖控制器呈現(xiàn)和解除處理滾動視圖)
How to Cancel Scrolling in UIScrollView(如何在 UIScrollView 中取消滾動)
主站蜘蛛池模板: 国产二区精品视频 | 国产精品人人做人人爽 | 久久性色 | 亚洲成人福利在线观看 | 国产成人区 | 成人aaa视频| 白浆在线 | 精品国产一区二区国模嫣然 | 久久久国产网站 | 成人欧美一区二区三区黑人孕妇 | 蜜臀av日日欢夜夜爽一区 | 97国产精品视频 | av天天干| 国产精品久久久久久久三级 | 国产一二区视频 | 97精品久久 | 日韩网站在线观看 | 一级黄色网页 | 成人不卡一区二区 | 久久久精品一区二区 | www国产亚洲精品 | 特级黄一级播放 | 美女黄视频网站 | 久久国产精品久久久久久久久久 | 精品视频一区二区三区在线观看 | 日本在线一区二区三区 | 爱爱小视频 | 国产极品粉嫩美女呻吟在线看人 | 黄色日批视频 | 欧美激情精品久久久久久变态 | 国产精品99久久久久久久vr | 亚洲精品白浆高清久久久久久 | 91久久久久久久久久久 | 亚洲欧美中文日韩在线 | 精品久久香蕉国产线看观看亚洲 | 亚洲精品一区在线 | 亚洲精品乱码久久久久久按摩观 | 国产美女在线看 | 天天人人精品 | 自拍视频一区二区三区 | 久久久久香蕉视频 |