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

iOS UIScrollView取消UIButton觸摸滾動(dòng)

iOS UIScrollView cancel UIButton touch on scroll(iOS UIScrollView取消UIButton觸摸滾動(dòng))
本文介紹了iOS UIScrollView取消UIButton觸摸滾動(dòng)的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我在 UIScrollView 中有一些 UIButton,但我不想延遲按鈕的觸摸.但是,一旦滾動(dòng)視圖檢測(cè)到拖動(dòng)/滾動(dòng),我想取消 UIButton 觸摸并繼續(xù)滾動(dòng) UIScrollView.

I have some UIButtons within a UIScrollView, but I do not want to delay the button touches. However, as soon as the scroll view detects a drag/scroll, I want to cancel the UIButton touch and proceed with the scrolling of the UIScrollView.

我已包含以下內(nèi)容...

I have included the following...

_scrollView.delaysContentTouches = NO;

...但是(顯然)按鈕觸摸在拖動(dòng)時(shí)不會(huì)取消.有人對(duì)我如何實(shí)現(xiàn)此功能有任何建議嗎?

...but (obviously) the button touch does not cancel when dragged. Does anyone have any suggestions as to how I can implement this functionality?

推薦答案

你可以重寫UIScrollView的這個(gè)方法.

You can override this method of UIScrollView.

-(BOOL)touchesShouldCancelInContentView:(UIView *)view
{   
    return YES;
}

在你的 UIButton 中,你應(yīng)該為不同的控件事件添加不同的方法.

And in your UIButton, you should add different method for different control events.

  1. 顯示 UIControlEventTouchDown 的高亮效果.
  2. UIControlEventTouchUpInside 的觸發(fā)按鈕 |UIControlEventTouchUpOutside;
  3. 清除UIControlEventTouchCancel的高亮效果.
  1. show highlight effect for UIControlEventTouchDown.
  2. trigger button for UIControlEventTouchUpInside | UIControlEventTouchUpOutside;
  3. clear highlight effect for UIControlEventTouchCancel.

這篇關(guān)于iOS UIScrollView取消UIButton觸摸滾動(dòng)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(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 中縮放和捏合)
主站蜘蛛池模板: 四虎最新地址 | 精品视频一区二区三区在线观看 | 91精品国产欧美一区二区成人 | 国产中文视频 | 91视频.com | 99re视频在线 | 欧洲成人免费视频 | 精产国产伦理一二三区 | 国产免费一区二区 | 国产 欧美 日韩 一区 | 在线看av的网址 | 亚洲v日韩v综合v精品v | 中文字幕一区二区三区四区不卡 | 在线午夜 | 国产自产c区 | 欧美aⅴ片| 在线免费中文字幕 | 欧美一区二区三区在线观看 | 国产精品69毛片高清亚洲 | a黄视频| 蜜桃av人人夜夜澡人人爽 | 久久99精品久久久久久青青日本 | 精品一二三区 | 91国产在线视频在线 | 国产日韩91| 国产精品久久久久久久久久 | 日韩高清中文字幕 | 麻豆精品国产免费 | 亚洲欧美另类在线观看 | 国产一区二区三区在线看 | 国产一区二区在线91 | 天天拍天天插 | 久久久久久99 | 超碰国产在线 | 91精品久久久久久久久久入口 | xxx国产精品视频 | 亚洲精品久久久久avwww潮水 | 天天弄天天操 | 成人在线视频网址 | 免费在线播放黄色 | av在线一区二区三区 |