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

如何在 UIScrollView 中取消滾動

How to Cancel Scrolling in UIScrollView(如何在 UIScrollView 中取消滾動)
本文介紹了如何在 UIScrollView 中取消滾動的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我使用 UIScrollView 在 iPhone 上制作大尺寸(大于 320 像素)的 UI.

I use UIScrollView to make large-sized (larger than 320px) UI on iPhone.

我創建了一個 UIScrollView 實例并在其上添加了一些子視圖.問題是我只想在用戶觸摸子視圖之外時啟用滾動,當用戶觸摸其中一個子視圖時停止滾動.

I made an instance of UIScrollView and added some subviews on it. The problem is that I want to enable scrolling only when user touches outside of subviews, stop scrolling when user touches one of subviews.

我閱讀了文檔并嘗試查找示例,但找不到好的提示.如果您有任何想法,請幫助我.

I read documents and tried to find samples but I can't find good hint. If you have any idea, please help me.

推薦答案

如果你想檢測 UIScrollView 的任何子視圖內的觸摸,你必須繼承 UIScrollView 并覆蓋 touchesShouldBegintouchesShouldCancelInContentView 專門為此目的創建的方法.

If you want to detect touches inside any of the subviews of the UIScrollView, you will have to subclass UIScrollView and override the touchesShouldBegin and touchesShouldCancelInContentView methods which are specifically created for this purpose.

除此之外,您無法識別子視圖中的觸摸,因為 UIScrollView 傾向于自行處理所有觸摸并且不會將它們傳遞給其子視圖.

Other than this, there is no way you can identify touches in the subviews as UIScrollView tends to handle all touches itself and doesn't pass them to its subviews.

一切順利.

這篇關于如何在 UIScrollView 中取消滾動的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

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屋-程序員軟件開發技術分享社
ImageView Scaling when scrolling down(向下滾動時 ImageView 縮放)
Bounds automatically changes on UIScrollView with content insets(UIScrollView 上的邊界自動更改,帶有內容插圖)
iOS5 UITapRecognizer for UIScrollView interfering with buttons. How to fix?(用于 UIScrollView 的 iOS5 UITapRecognizer 干擾按鈕.怎么修?)
How can i add a activity indicator below the UITableView?(如何在 UITableView 下方添加活動指示器?)
主站蜘蛛池模板: 久色激情 | 国产精品a久久久久 | 欧美一区二区三区国产精品 | 中文在线一区二区 | 看a网站| 欧美日韩一卡二卡 | 国产高清在线观看 | 国产日韩精品一区二区 | 中文字幕一区二区在线观看 | 成人免费在线小视频 | 精品欧美一区二区中文字幕视频 | 99re在线视频 | 成人在线不卡 | 青草久久免费视频 | 操久久 | 国产亚洲网站 | 日韩免费中文字幕 | 成人国产在线视频 | 91色视频在线观看 | 国产精品99视频 | 免费国产网站 | 亚洲综合大片69999 | 日本免费一区二区三区 | 欧美一级片在线观看 | 凹凸日日摸日日碰夜夜 | 欧美区在线| 久久高清亚洲 | 国产精品视频久久 | 最新国产视频 | 综合精品在线 | 午夜免费视频 | 日韩精品视频在线 | 亚洲国产成人av好男人在线观看 | 亚洲欧美精品久久 | 欧美在线观看一区 | 日韩不卡一区二区 | 一区二区三区四区国产精品 | 日本特黄特色aaa大片免费 | 亚洲国产精品视频 | 在线观看特色大片免费网站 | 久久久久久久网 |