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

如何阻止 UIScrollView 吞下觸摸

How to Stop a UIScrollView from Swallowing Touches(如何阻止 UIScrollView 吞下觸摸)
本文介紹了如何阻止 UIScrollView 吞下觸摸的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我的 UIScrollView 有很多子視圖.當(dāng)我滾動(dòng)時(shí),我想點(diǎn)擊要拖動(dòng)的子視圖.有沒有辦法讓 UIScrollView 停止吞咽觸摸?或者當(dāng)您取消滾動(dòng)時(shí)是否可以開始新的觸摸(就像它滾動(dòng)并且我點(diǎn)擊它一樣,子視圖也會(huì)被點(diǎn)擊以便我可以將其拖出)?

I have UIScrollView that has many subviews. When I scroll, I want to tap on a subview which I want to be dragged. Is there a possible way to make the UIScrollView stop from swallowing touches? Or is it possible to start new touch when you cancel the scrolling (like what it scrolls and I tapped on it, the subview will be tapped as well so I can drag it out)?

推薦答案

繼承 UIScrollView 并覆蓋 - (BOOL)touchesShouldCancelInContentView:(UIView *)view 方法.這是一個(gè)允許 uibutton 觸摸通過的示例:

Subclass UIScrollView and override the - (BOOL)touchesShouldCancelInContentView:(UIView *)view method. Here's an example to allow uibutton touches to pass through:

#import "scrollViewWithButtons.h"

@implementation scrollViewWithButtons

- (BOOL)touchesShouldCancelInContentView:(UIView *)view
{
    return ![view isKindOfClass:[UISlider class]];
}

@end

這篇關(guān)于如何阻止 UIScrollView 吞下觸摸的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

Stop a UITableView from automatically scrolling(阻止 UITableView 自動(dòng)滾動(dòng))
iOS UIScrollView Lazy Loading(iOS UIScrollView 延遲加載)
using iOS 6.0 SDK and building for iOS 5 Target causes UIScrollView setMinimumZoomScale to fail when running on iOS 5 simulator(在 iOS 5 模擬器上運(yùn)行時(shí),使用 iOS 6.0 SDK 并為 iOS 5 Target 構(gòu)建會(huì)導(dǎo)致 UIScrollView setMinimumZ
Create partial-screen UIPageViewController programmatically(以編程方式創(chuàng)建部分屏幕 UIPageViewController)
how to make an ImageView zoomable with or without ScrollView.?(如何使用或不使用 ScrollView 使 ImageView 可縮放?)
UIImageView zoom and pinch in UIScrollView(UIImageView 在 UIScrollView 中縮放和捏合)
主站蜘蛛池模板: 免费理论片| 久久精品视频国产 | 欧美亚洲三级 | 久久久久久国产精品 | 日韩精品视频一区二区三区 | 师生出轨h灌满了1v1 | 亚洲狠狠干 | 成人爱爱| 久久免费视频观看 | 免费看大片a | 国产欧美日韩在线观看 | 国产精品久久一区二区三区 | 毛片网站视频 | 红桃av在线 | 欧美不卡一区 | 精品亚洲一区二区三区 | av高清在线观看 | 午夜爽爽影院 | 色呦呦国产精品 | 亚洲视频在线播放 | av毛片网站 | 天天操天天操 | 亚洲综合色网 | 欧美日韩亚洲一区二区三区 | 一区二区三区免费观看 | 国产a精品 | 日韩成人小视频 | 日本精品视频在线观看 | 国产在线天堂 | 欧美日韩不卡 | 少妇高潮久久久久久潘金莲 | 成人aaaa| 亚洲国产成人在线 | 欧美一区免费 | 青青草成人在线 | 黄在线观看 | 成人免费网站黄 | 精品无人国产偷自产在线 | 日韩一区二区视频 | 在线观看日韩 | 黄www.|