久久久久久久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)
主站蜘蛛池模板: 亚洲欧美一区二区三区国产精品 | 一区二区三区免费 | 欧美一级片a | 亚洲午夜电影 | 9色视频在线 | 91精品久久久久久久久久 | 国产在线拍偷自揄拍视频 | 天天曰天天曰 | 日韩国产精品一区二区三区 | 韩国av电影网 | 欧美极品在线视频 | 欧美一级二级视频 | 日韩精品久久久 | 色免费在线视频 | 中文字幕亚洲一区二区va在线 | 亚洲人免费视频 | 国产精品成人在线观看 | 911网站大全在线观看 | 国产精品1 | 狠狠做六月爱婷婷综合aⅴ 国产精品视频网 | 成人一区二区三区在线观看 | 美女视频网站久久 | 欧美一级免费黄色片 | 成人黄色电影在线播放 | 天天操狠狠操 | 久久久蜜桃 | 免费黄色av | 日韩aⅴ在线观看 | 日韩欧美一区二区三区在线播放 | 一区视频在线免费观看 | 亚洲国产成人精品女人久久久 | www国产精 | 国产一区日韩在线 | 精品日韩欧美一区二区 | 亚洲成av人片在线观看 | 97久久精品午夜一区二区 | 国产免费一区 | 午夜影视网 | 中文字幕一区二区三区不卡 | 日韩三级免费网站 | 欧美精品一区二区三区四区五区 |