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

以編程方式設(shè)置 contentOffset 觸發(fā) scrollViewDidScrol

Setting contentOffset programmatically triggers scrollViewDidScroll(以編程方式設(shè)置 contentOffset 觸發(fā) scrollViewDidScroll)
本文介紹了以編程方式設(shè)置 contentOffset 觸發(fā) scrollViewDidScroll的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我在一個(gè)頁面上有幾個(gè) UIScrollView.您可以單獨(dú)滾動(dòng)它們或?qū)⑺鼈冩i定在一起并將它們作為一個(gè)滾動(dòng).當(dāng)它們被鎖定時(shí)會(huì)出現(xiàn)問題.

I've got a a few UIScrollView on a page. You can scroll them independently or lock them together and scroll them as one. The problem occurs when they are locked.

我使用 UIScrollViewDelegatescrollViewDidScroll: 來跟蹤運(yùn)動(dòng).我查詢 UIScrollViewcontentOffset 已更改,然后通過將其 contentOffset 屬性設(shè)置為匹配來反映更改到其他滾動(dòng)視圖.

I use UIScrollViewDelegate and scrollViewDidScroll: to track movement. I query the contentOffset of the UIScrollView which changed and then reflect change to other scroll views by setting their contentOffset property to match.

太好了....除了我注意到很多額外的電話.以編程方式更改滾動(dòng)視圖的 contentOffset 會(huì)觸發(fā)委托方法 scrollViewDidScroll: 被調(diào)用.我嘗試使用 setContentOffset:animated: 代替,但我仍然在委托上獲得觸發(fā)器.

Great.... except I noticed a lot of extra calls. Programmatically changing the contentOffset of my scroll views triggers the delegate method scrollViewDidScroll: to be called. I've tried using setContentOffset:animated: instead, but I'm still getting the trigger on the delegate.

如何以編程方式修改我的 contentOffsets 以不觸發(fā) scrollViewDidScroll:?

How can I modify my contentOffsets programmatically to not trigger scrollViewDidScroll:?

實(shí)施說明....每個(gè) UIScrollView 都是自定義 UIView 的一部分,它使用委托模式回調(diào)處理協(xié)調(diào)各種 contentOffset 的呈現(xiàn) UIViewController 子類 值.

Implementation notes.... Each UIScrollView is part of a custom UIView which uses delegate pattern to call back to the presenting UIViewController subclass that handles coordinating the various contentOffset values.

推薦答案

可以在不觸發(fā)委托回調(diào)scrollViewDidScroll:的情況下改變UIScrollView的內(nèi)容偏移量,通過設(shè)置 UIScrollView 的邊界并將原點(diǎn)設(shè)置為所需的內(nèi)容偏移量.

It is possible to change the content offset of a UIScrollView without triggering the delegate callback scrollViewDidScroll:, by setting the bounds of the UIScrollView with the origin set to the desired content offset.

CGRect scrollBounds = scrollView.bounds;
scrollBounds.origin = desiredContentOffset;
scrollView.bounds = scrollBounds;

這篇關(guān)于以編程方式設(shè)置 contentOffset 觸發(fā) scrollViewDidScroll的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

How to subclass UIScrollView and make the delegate property private(如何繼承 UIScrollView 并使委托屬性私有)
Swift - how to get last taken 3 photos from photo library?(Swift - 如何從照片庫中獲取最后拍攝的 3 張照片?)
Photos app-like gap between pages in UIScrollView with pagingEnabled(使用 pagingEnabled 的 UIScrollView 中頁面之間的照片應(yīng)用程序式間隙)
why UIScrollView is leaving space from top in ios 6 and ios 7(為什么 UIScrollView 在 ios 6 和 ios 7 中從頂部留下空間)
UIScrollView pauses NSTimer while scrolling(UIScrollView 在滾動(dòng)時(shí)暫停 NSTimer)
Limiting the scrollable area in UIScrollView(限制 UIScrollView 中的可滾動(dòng)區(qū)域)
主站蜘蛛池模板: 午夜影院在线观看免费 | 97久久久| 一区二区视频 | 欧美精品一区久久 | 成人国产精品色哟哟 | 亚洲综合精品 | 亚洲国产精品一区二区第一页 | 亚洲成人一级片 | 国产精品成人一区二区三区夜夜夜 | 一级在线免费观看 | 午夜精品一区二区三区免费视频 | 国产激情视频在线免费观看 | 午夜一区二区三区视频 | 欧美成人一级 | 欧美在线视频一区 | 国产精品久久久久久久久免费软件 | 亚洲日本欧美日韩高观看 | 久久久久国产 | 91精品久久久久久久久 | www亚洲成人| 99久久国产综合精品麻豆 | 久久不射网 | 国产日韩欧美一区 | 久久国产精品99久久久大便 | 三a毛片| 黄色大片视频 | 中文字幕在线看 | 久久亚洲精品视频 | 久久久久久久久久影视 | 国产欧美一区二区三区日本久久久 | 亚洲精品68久久久一区 | 午夜激情小视频 | 国产成人精品一区二 | 色橹橹欧美在线观看视频高清 | 成人免费视频在线观看 | 国产午夜三级一区二区三 | 第四色影音先锋 | 亚洲精品一区中文字幕乱码 | 一区二区三区视频 | 久久久成人免费一区二区 | 在线日韩 |