久久久久久久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模板網(wǎng)!

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

                相關文檔推薦

                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(圖標已經(jīng)包含光澤效果)
                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>
                          主站蜘蛛池模板: 久久久久久999 | 久久久久国产 | 亚洲一区二区在线视频 | 国产一区二区在线91 | 91久久国产综合久久91精品网站 | 中文字幕亚洲欧美日韩在线不卡 | 久久精品视频亚洲 | 欧美午夜一区 | 中文字幕在线看 | 国产区在线观看 | 麻豆精品一区二区三区在线观看 | 国产精品不卡视频 | 久久精品99 | 午夜爱爱网 | 91日韩在线 | 国产成人精品一区二区三区四区 | 国产精品久久久久影院色老大 | 三级成人在线 | 久久久久国产精品 | 欧美精品video | 欧美激情一区二区 | 日韩精品1区2区3区 爱爱综合网 | 日韩三级一区 | 亚洲精品福利在线 | 亚洲一二三区在线观看 | 亚洲一区二区国产 | 日本a在线| 91影片 | 羞羞色在线观看 | 精品国产一区二区三区免费 | 一区二区视频 | 久久亚洲91 | 国产一区二区不卡 | 亚洲精品久久久9婷婷中文字幕 | 91久久精品国产91久久 | 欧美精品一区在线 | 国产视频中文字幕 | 欧美视频偷拍 | 四虎影院在线播放 | 国产在线精品一区二区三区 | 亚洲精品乱码久久久久久蜜桃91 |