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

帶有“圓形"的 UIScrollView滾動

UIScrollView with quot;Circularquot; scrolling(帶有“圓形的 UIScrollView滾動)
本文介紹了帶有“圓形"的 UIScrollView滾動的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我正在嘗試在我的 UIScrollView 中進(jìn)行循環(huán)"滾動,但沒有成功.

I am trying to make "Circular" scrolling in my UIScrollView, but unsuccessful.

我想做什么:如果 uiscrollview 到達(dá)結(jié)束,它應(yīng)該移動開始如果 uiscrollview 在開始并向后移動,它應(yīng)該移動到結(jié)束

What I want to do: if uiscrollview reaches end, it should move to start if uiscrollview at start and moving back, it should move to end

在我的情況下附加滾動視圖不是好方法(其他方法應(yīng)該得到頁面ID")

Appending scrollview isn't good way in my situation (other methods should get "page id")

你有什么想法嗎?

推薦答案

我已經(jīng)實(shí)現(xiàn)了這個方法,但是它需要啟用分頁.假設(shè)您有五個元素 A、B、C、D 和 E.設(shè)置視圖時,將最后一個元素添加到開頭,將第一個元素添加到結(jié)尾,并調(diào)整內(nèi)容偏移量以查看第一個元素,例如 E,[A],B,C,D,E,A.在 UIScrollViewDelegate 中,檢查用戶是否到達(dá)任何一端,并將偏移 without 動畫移動到另一端.

I've implemented this method, but it requires paging enabled. Lets assume you have five elements A,B,C,D and E. When you set up your view, you add the last element to the beginning and the first element to the end, and adjust the content offset to view the first element, like this E,[A],B,C,D,E,A. In the UIScrollViewDelegate, check if the user reach any of the ends, and move the offset without animation to the other end.

想象一下 [ ] 表示正在顯示的視圖:

Imagine the [ ] indicates the view being shown:

E,A,B,C,[D],E,A

用戶向右滑動

E,A,B,C,D,[E],A

用戶向右滑動

E,A,B,C,D,E,[A]

然后,自動設(shè)置內(nèi)容偏移到第二個元素

Then, automatically set the content offset to the second element

E,[A],B,C,D,E,A

通過這種方式,用戶可以雙向滑動創(chuàng)建無限滾動的錯覺.

This way the user can swipe both ways creating the illusion of an infinite scroll.

E,A,[B],C,D,E,A


更新

我已經(jīng)上傳了該算法的完整實(shí)現(xiàn).這是一個非常復(fù)雜的類,因?yàn)樗€具有點(diǎn)擊選擇、無限循環(huán)滾動和單元格重用.您可以按原樣使用代碼,修改它或提取您需要的代碼.最有趣的代碼在 TCHorizo??ntalSelectorView 類中.


Update

I've uploaded a complete implementation of this algorithm. It's a very complicated class, because it also has on-click selection, infinite circular scroll and cell reuse. You can use the code as is, modify it or extract the code that you need. The most interesting code is in the class TCHorizontalSelectorView.

文件鏈接

盡情享受吧!

UICollectionView 現(xiàn)在是實(shí)現(xiàn)此目的的推薦方法,它可用于獲得完全相同的行為.本教程詳細(xì)描述了如何去實(shí)現(xiàn)它.

UICollectionView is now the recommended way to achieve this and it can be used to obtain the very same behavior. This tutorial describes in details how to achieve it.

這篇關(guān)于帶有“圓形"的 UIScrollView滾動的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(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 張照片?)
Setting contentOffset programmatically triggers scrollViewDidScroll(以編程方式設(shè)置 contentOffset 觸發(fā) scrollViewDidScroll)
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 在滾動時暫停 NSTimer)
主站蜘蛛池模板: 亚洲协和影视 | av片网 | 久久精品国产一区二区三区不卡 | 精品一二 | 亚洲在线免费 | 999观看免费高清www | 久久成人一区 | 狠狠躁天天躁夜夜躁婷婷老牛影视 | 久久久久久91 | 亚洲精品888| 国产精品视屏 | av高清毛片| 99re视频在线观看 | 亚洲精品久久嫩草网站秘色 | 深夜福利亚洲 | 噜噜噜噜狠狠狠7777视频 | 中文字幕一区二区三区精彩视频 | 亚洲 中文 欧美 日韩 在线观看 | 国产99久久精品一区二区永久免费 | 成人av观看 | 午夜精品久久久久久久99黑人 | 九九免费视频 | 精品一二区 | 999热精品 | 久久99精品久久久久久国产越南 | 国产一区二区三区四区 | a免费视频 | 一二三区在线 | 91大神在线资源观看无广告 | av网站在线免费观看 | 韩国主播午夜大尺度福利 | 亚洲人成在线播放 | 99热激情 | 日日夜夜天天综合 | 欧美a区| 欧美视频成人 | 色视频网站在线观看 | 亚洲一区二区成人 | jav成人av免费播放 | 亚洲天堂av网 | 国产在线一区二区三区 |