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

UI滾動視圖.關于實現“無限"的任何想法滾動

UIScrollView. Any thoughts on implementing quot;infinitequot; scroll/zoom?(UI滾動視圖.關于實現“無限的任何想法滾動/縮放?)
本文介紹了UI滾動視圖.關于實現“無限"的任何想法滾動/縮放?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

所以,UITableView 基本上支持無限"滾動.可能有一個限制,但那個傻瓜可以滾動很長時間.我想用 UIScrollView 來模仿這種行為,但有兩個基本障礙:

So, UITableView supports essentially "infinite" scrolling. There' may be a limit but that sucker can scroll for a looonnnggg time. I would like to mimic this behavior with a UIScrollView but there are two fundamental impediments:

1) scrollView.contentSize 在創建時是固定的.2) 縮放可以將任何延遲加載方案徹底摧毀,因為它會導致無限數據爆炸.

1) scrollView.contentSize is fixed at creation time. 2) zooming can blow any lazy-loading scheme all to hell since it can cause infinte data explosion.

有沒有其他人思考過這個想法?是的,我知道,我們本質上是在討論重新創建谷歌地圖.任何見解將不勝感激.

Have others out there pondered this idea? Yah, I know, we are essentially talking about re-creating Google Maps here. Any insights would be much appreciated.

干杯,道格

推薦答案

雖然不可能擁有真正無限的 UIScrollView,但您可以使用一些簡單的技巧來模擬這種行為.

While it's impossible to have a truly infinite UIScrollView, there are some simple tricks you can use to emulate that behavior.

  1. 處理固定的 contentSize:讓滾動視圖處理一些固定大小的視圖,并在啟動或實例化時設置內容偏移量,以便您看到已處理視圖的中間.然后只需觀察內容偏移量(使用 KVO 或其他方法),如果您靠近任何邊緣,則使用一組新內容(適當偏移)更新視圖的內容并重置滾動視圖的 contentOffset 屬性回到中間.
  2. 處理縮放:做類似的事情,只是這次注意滾動視圖上的縮放系數.每當它到達某個點時,對您呈現的任何數據進行一些操作,使其顯示為已縮放,然后將縮放因子重置為 1.0.例如,如果您正在滾動圖像并且它被縮放以顯示兩倍大,則以編程方式應用某種變換以使圖像大兩倍,然后將滾動視圖的縮放因子重置為 1.0.圖像仍會放大顯示,但滾動視圖將能夠根據需要繼續進一步放大.(Google 地圖更進一步,它在用戶縮放時延遲加載更詳細的視圖 - 您可以選擇也可以不選擇實現這一點.)
  1. Handling the fixed contentSize: have some fixed-size view handled by your scroll view, and at launch or instantiation, set the content offset so that you're seeing the middle of the handled view. Then just watch the content offset (using KVO or some other method), and if you near any edge, update the content of the view with a new set of content (offset appropriately) and reset the scroll view's contentOffset property to be back in the middle.
  2. Handling zooming: do something similar, only this time watch the zoom factor on the scroll view. Whenever it gets to a certain point, do some manipulation to whatever data you're presenting so that it appears zoomed, then reset the zoom factor to 1.0. For example, if you're scrolling an image and it gets zoomed to appear twice as large, programmatically apply some kind of transform to make the image twice as large, then reset the scroll view's zoom factor to 1.0. The image will still appear zoomed in, but the scroll view will be able to continue zooming in further as necessary. (Google Maps takes this one step further where it lazy-loads more detailed views as the user zooms - you may or may not choose to implement this.)

這篇關于UI滾動視圖.關于實現“無限"的任何想法滾動/縮放?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

How to subclass UIScrollView and make the delegate property private(如何繼承 UIScrollView 并使委托屬性私有)
Swift - how to get last taken 3 photos from photo library?(Swift - 如何從照片庫中獲取最后拍攝的 3 張照片?)
Setting contentOffset programmatically triggers scrollViewDidScroll(以編程方式設置 contentOffset 觸發 scrollViewDidScroll)
Photos app-like gap between pages in UIScrollView with pagingEnabled(使用 pagingEnabled 的 UIScrollView 中頁面之間的照片應用程序式間隙)
why UIScrollView is leaving space from top in ios 6 and ios 7(為什么 UIScrollView 在 ios 6 和 ios 7 中從頂部留下空間)
UIScrollView pauses NSTimer while scrolling(UIScrollView 在滾動時暫停 NSTimer)
主站蜘蛛池模板: 久久九| 日韩男人天堂 | 在线激情视频 | 亚洲不卡av在线 | 日日草夜夜草 | 国产精品精品视频一区二区三区 | 日韩欧美国产一区二区三区 | 久久久国产一区二区 | 久久久久国产精品一区二区 | 激情六月天 | 一本色道久久综合亚洲精品高清 | 国产成人综合一区二区三区 | 亚洲精品成人 | 九九99九九精彩46 | www四虎com| 成人在线视频免费播放 | 国产精品观看 | 亚洲成色777777在线观看影院 | 综合网视频 | 久久久久久久久久久久一区二区 | 久久精品亚洲精品国产欧美kt∨ | 一区二区三区四区免费观看 | 亚洲一区免费在线 | 亚洲精品一区中文字幕乱码 | 成年人在线播放 | 99视频在线免费观看 | 亚洲一本 | 久久精品色欧美aⅴ一区二区 | 国产欧美一区二区三区在线看蜜臀 | 亚洲综合色视频在线观看 | 成人免费网站在线 | 亚洲精品久久久久久久久久久久久 | 国产精品a一区二区三区网址 | 伊人影院99| 国产精品一区在线观看你懂的 | 一区二区三区四区在线视频 | 免费黄色a级毛片 | av一区在线观看 | 亚洲一区二区av | 亚洲最新在线 | 一区在线视频 |