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

    • <bdo id='dY97d'></bdo><ul id='dY97d'></ul>
  1. <tfoot id='dY97d'></tfoot>

  2. <legend id='dY97d'><style id='dY97d'><dir id='dY97d'><q id='dY97d'></q></dir></style></legend>
    1. <i id='dY97d'><tr id='dY97d'><dt id='dY97d'><q id='dY97d'><span id='dY97d'><b id='dY97d'><form id='dY97d'><ins id='dY97d'></ins><ul id='dY97d'></ul><sub id='dY97d'></sub></form><legend id='dY97d'></legend><bdo id='dY97d'><pre id='dY97d'><center id='dY97d'></center></pre></bdo></b><th id='dY97d'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='dY97d'><tfoot id='dY97d'></tfoot><dl id='dY97d'><fieldset id='dY97d'></fieldset></dl></div>

      <small id='dY97d'></small><noframes id='dY97d'>

    2. 如何在 iPhone 中制作無限滾動視圖?

      How to make infinite scroll view in iPhone?(如何在 iPhone 中制作無限滾動視圖?)
        <legend id='uzzWC'><style id='uzzWC'><dir id='uzzWC'><q id='uzzWC'></q></dir></style></legend>
        <tfoot id='uzzWC'></tfoot>

                <tbody id='uzzWC'></tbody>
                <bdo id='uzzWC'></bdo><ul id='uzzWC'></ul>
                <i id='uzzWC'><tr id='uzzWC'><dt id='uzzWC'><q id='uzzWC'><span id='uzzWC'><b id='uzzWC'><form id='uzzWC'><ins id='uzzWC'></ins><ul id='uzzWC'></ul><sub id='uzzWC'></sub></form><legend id='uzzWC'></legend><bdo id='uzzWC'><pre id='uzzWC'><center id='uzzWC'></center></pre></bdo></b><th id='uzzWC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='uzzWC'><tfoot id='uzzWC'></tfoot><dl id='uzzWC'><fieldset id='uzzWC'></fieldset></dl></div>

                <small id='uzzWC'></small><noframes id='uzzWC'>

              • 本文介紹了如何在 iPhone 中制作無限滾動視圖?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我有一個 scrollview,其中有 5 個寬度為 88 的圖像視圖.

                I have a scrollview with 5 image views of width 88.

                我希望 scrollview 滾動到每個圖像視圖 (非分頁)

                I want the scrollview to scroll to each image view (Not Paging)

                我想在 iPhone 中制作一個無限滾動視圖,這意味著當它滾動到最后一個項目時,它會在它旁邊顯示第一個項目..

                I want to make an infinite scrollview in iPhone which means the when it scroll to last item it will display a first item next to it..

                我一直在嘗試按偏移量,但是當按偏移量移動它時它會停止,而且 我使用了蘋果街道滾動條,它不允許我將每個元素停止在中心(就像選擇器視圖)..>

                I have been trying by offset but it stops when move it by offset and also I have used apple street scroller which does not allow me to stop each element in center(just like Picker view)..

                推薦答案

                首先,我推薦使用 UITableView,這樣可以保持較低的內存使用率.我在一個項目中成功使用的方法如下:

                First of all, I recommend to use a UITableView so you can maintain the memory usage low. An approach that I had used successfully in a project is the following:

                  1.列表項

                復制單元格的內容,我的意思是如果你有 5 個這樣的項目:

                Duplicate the content of your cells, I mean if you have 5 items in this way:

                |1 |2 |3 |4 |5 |

                | 1 | 2 | 3 | 4 | 5 |

                您應該在表格末尾添加相同的內容(在具有可重用引擎的表格視圖中,這不是什么大問題),以便看起來像這樣:

                You should add the same (In a table view with reusable engine that's not a big deal) at the end of the table in order to look like this:

                |1 |2 |3 |4 |5 |1 |2 |3 |4 |5 |

                | 1 | 2 | 3 | 4 | 5 | 1 | 2 | 3 | 4 | 5 |

                  2.修改 scrollViewDidScroll 如下:
                  2. modify the scrollViewDidScroll with the following:

                -(void)scrollViewDidScroll:(UIScrollView *)scrollView
                {
                    if (scrollView == _yourScrollView) {
                        CGFloat currentOffsetX = scrollView.contentOffset.x;
                        CGFloat currentOffSetY = scrollView.contentOffset.y;
                        CGFloat contentHeight = scrollView.contentSize.height;
                
                        if (currentOffSetY < (contentHeight / 6.0f)) {
                            scrollView.contentOffset = CGPointMake(currentOffsetX,(currentOffSetY + (contentHeight/2)));
                        }
                        if (currentOffSetY > ((contentHeight * 4)/ 6.0f)) {
                            scrollView.contentOffset = CGPointMake(currentOffsetX,(currentOffSetY - (contentHeight/2)));
                        }
                    }
                }
                

                如果您幾乎到達滾動的最后,上面的代碼將滾動位置移動到頂部;或者,如果您幾乎在頂部,則將您移至底部...

                The code above move the scroll position at top if you almost reach the final of the scrolling; Or if you are almost on the top, moves you to the bottom...

                  3.就是這樣.

                這篇關于如何在 iPhone 中制作無限滾動視圖?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                相關文檔推薦

                How to animate a UIImageview to display fullscreen by tapping on it?(如何通過點擊動畫 UIImageview 以顯示全屏?)
                To stop segue and show alert(停止 segue 并顯示警報)
                iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                Icon already includes gloss effects(圖標已經包含光澤效果)
                How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
                UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進度圖像(iOS 5 屬性))
                • <small id='5kNdN'></small><noframes id='5kNdN'>

                  1. <i id='5kNdN'><tr id='5kNdN'><dt id='5kNdN'><q id='5kNdN'><span id='5kNdN'><b id='5kNdN'><form id='5kNdN'><ins id='5kNdN'></ins><ul id='5kNdN'></ul><sub id='5kNdN'></sub></form><legend id='5kNdN'></legend><bdo id='5kNdN'><pre id='5kNdN'><center id='5kNdN'></center></pre></bdo></b><th id='5kNdN'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5kNdN'><tfoot id='5kNdN'></tfoot><dl id='5kNdN'><fieldset id='5kNdN'></fieldset></dl></div>

                      <tbody id='5kNdN'></tbody>
                  2. <legend id='5kNdN'><style id='5kNdN'><dir id='5kNdN'><q id='5kNdN'></q></dir></style></legend>
                        • <bdo id='5kNdN'></bdo><ul id='5kNdN'></ul>

                          <tfoot id='5kNdN'></tfoot>
                          主站蜘蛛池模板: 欧美国产日韩一区 | 激情毛片 | 中国黄色毛片视频 | 国产91丝袜在线播放 | 亚洲精选久久 | 成人欧美一区二区三区黑人孕妇 | 美女天天操 | av二区三区| 久久久免费毛片 | 国产精品2| 91免费入口 | 成人小视频在线观看 | 亚洲欧美bt | 噜噜噜噜狠狠狠7777视频 | 91天堂网 | 亚洲精品68久久久一区 | 国产一区二区在线播放 | 午夜欧美日韩 | 欧美成人精品一区二区三区 | 欧美一级片免费看 | 玖玖综合网 | 国产美女一区二区 | 免费观看视频www | 欧美精 | 国产精品久久久久久久久 | 久综合| 国产成人精品免费视频 | 91一区二区三区 | 日韩电影一区 | 神马久久久久久久久久 | 一区二区三区在线观看免费视频 | av黄色片在线观看 | 四虎影视在线 | a在线视频 | 日韩在线资源 | 一区二区三区四区av | 四虎永久免费黄色影片 | 中文字幕亚洲精品 | 99热播放 | 日韩电影免费在线观看中文字幕 | 91精品国产综合久久香蕉麻豆 |