久久久久久久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)
主站蜘蛛池模板: 日韩欧美在线一区 | 超碰人人人人 | 亚洲国产精品激情在线观看 | 国产精品美女久久久久久久久久久 | 中文字幕在线精品 | 欧美在线一区二区三区四区 | 天天宗合网 | 精品国产伦一区二区三区观看说明 | 日本粉嫩一区二区三区视频 | 欧美视频精品 | 久久欧美精品 | 亚洲一区二区久久久 | 精品一区二区观看 | 国产一区二 | 天天搞天天操 | 国产高清一区二区三区 | 超碰在线播 | 久久久人成影片免费观看 | 久久国产一区二区三区 | 99久久夜色精品国产亚洲96 | 暖暖成人免费视频 | 国产成人jvid在线播放 | av中文字幕在线观看 | 国产一区二区三区久久久久久久久 | 欧美 日韩精品 | 91精品久久久久久久久中文字幕 | 中文字幕不卡一区 | 岛国毛片在线观看 | 久久久久久久国产 | 无吗视频| 午夜国产精品视频 | 不卡一区二区三区四区 | 国产精品久久久久久久久久免费看 | 亚洲一区免费视频 | 精品久久久久久 | 国产亚洲欧美在线视频 | 一区二区三区免费在线观看 | 一区二区不卡 | 日韩乱码在线 | 毛片国产| 国产精品成人久久久久 |