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

以編程方式強制 UIScrollView 停止滾動,以便與多個

Programmatically force a UIScrollView to stop scrolling, for sharing a table view with multiple data sources(以編程方式強制 UIScrollView 停止滾動,以便與多個數據源共享表格視圖) - IT屋-程序員軟件開發技術分享
本文介紹了以編程方式強制 UIScrollView 停止滾動,以便與多個數據源共享表格視圖的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個 UITableView,當用戶觸摸分段控件時,它的數據源和委托在幾個自定義數據源對象之間切換(想想應用商店應用中的Top Paid"與Top Free").

I have a UITableView whose data source and delegate are switched between a couple of custom data source objects when the user touches a segmented control (think "Top Paid" vs "Top Free" in the app store app).

每個數據源對象保存它的最后滾動內容偏移量,并在它成為表格視圖的活動數據源時恢復它,方法是:

Each data source object saves its last scroll content offset, and restores it when it becomes the active data source for the table view by doing:

tableView.contentOffset = CGPointMake(0, savedScrollPosition);

這在用戶在表格靜止時切換數據源時效果很好,但是如果用戶在表格仍在移動(即減速)時點擊分段控件,表格視圖會繼續從舊的偏移量開始減速,有效地覆蓋我的 contentOffset 分配.

This works well when the user switches the data source when the table is at rest, but if the user hits the segmented control while the table is still moving (i.e. decelerating), the table view continues to decelerate from the old offset, effectively overriding my contentOffset assignment.

有沒有辦法在我設置 contentOffset 時強制表格視圖停止滾動/減速,或者有其他方法使這種類型的可切換數據源表格視圖工作?

Is there a way to force the table view to stop scrolling/decelerating when I set the contentOffset, or another way to make this type of switchable-data-source table view work?

推薦答案

這2個方法你試過了嗎?

Did you try these 2 methods?

它們實際上適用于滾動",而不僅僅是內容的偏移量.

They actually apply to the "scrolling" not just the offset of the content.

[self.tableView  scrollToRowAtIndexPath:savedIndexPath atScrollPosition:UITableViewScrollPositionTop animated:NO];

或者:

[self.tableView  scrollRectToVisible:savedFrame animated:NO];

它們實際上應該影響滾動并通過擴展來加速表格,而不僅僅是屏幕上可見的內容.

They should actually effect the scrolling and by extension the acceleration of the table, not just what is visible on screen.

這篇關于以編程方式強制 UIScrollView 停止滾動,以便與多個數據源共享表格視圖的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

Clean autorotation transitions in a paging UIScrollView(清除分頁 UIScrollView 中的自動旋轉轉換)
How to create an image from a UIView / UIScrollView(如何從 UIView/UIScrollView 創建圖像)
How to auto scroll UIScrollView using timer?(如何使用計時器自動滾動 UIScrollView?)
What does contentOffset do in a UIScrollView?(UIScrollView 中的 contentOffset 有什么作用?)
How to implement UIScrollView with 1000+ subviews?(如何實現具有 1000 多個子視圖的 UIScrollView?)
Adding a header view to a UIWebView similar to Safari and Articles(將標題視圖添加到類似于 Safari 和文章的 UIWebView)
主站蜘蛛池模板: 天天搞天天操 | 亚洲电影第1页 | 99久久99| 99久久99热这里只有精品 | 国产黄色大片网站 | 在线观看国产www | 久久婷婷国产香蕉 | 亚洲精品三级 | 国产日韩精品久久 | 性一交一乱一伦视频免费观看 | www.se91 | 超碰97免费 | 久久乐国产精品 | 久久久久免费精品国产小说色大师 | 日韩精品一区二区三区在线 | 国产高清视频一区二区 | 国产精品久久久久久久久久久免费看 | 免费观看毛片 | 亚洲免费在线观看视频 | 中文字幕av一区 | 亚洲精品68久久久一区 | 成人欧美日韩一区二区三区 | 久久久久久免费毛片精品 | 亚洲日韩中文字幕一区 | 久久久www成人免费精品张筱雨 | 国产精品久久久久久久久久久久久 | 国产亚洲一区二区三区在线 | www视频在线观看 | 亚洲成人av一区二区 | 天天夜天天操 | 精品av | 欧美日韩在线观看一区二区三区 | 国产在线精品一区二区三区 | 懂色av蜜桃av| 日韩a v在线免费观看 | 99tv| 亚洲精品久久国产高清情趣图文 | 日本一区二区三区免费观看 | 国产精品一区二区不卡 | 日韩快播电影网 | 97伦理电影 |