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

以小于幀大小的增量分頁 UIScrollView

Paging UIScrollView in increments smaller than frame size(以小于幀大小的增量分頁 UIScrollView)
本文介紹了以小于幀大小的增量分頁 UIScrollView的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個滾動視圖,它是屏幕的寬度,但只有大約 70 像素高.它包含許多 50 x 50 的圖標(周圍有空格),我希望用戶能夠從中進行選擇.但我總是希望滾動視圖以分頁的方式運行,總是在正中心的圖標處停止.

I have a scroll view that is the width of the screen but only about 70 pixels high. It contains many 50 x 50 icons (with space around them) that I want the user to be able to choose from. But I always want the scroll view to behave in a paged manner, always stopping with an icon in the exact center.

如果圖標是屏幕的寬度,這不會是一個問題,因為 UIScrollView 的分頁會處理它.但是因為我的小圖標遠小于內容大小,所以不起作用.

If the icons were the width of the screen this wouldn't be a problem because the UIScrollView's paging would take care of it. But because my little icons are much less than the content size, it doesn't work.

我之前在一個調用 AllRecipes 的應用中看到過這種行為.我只是不知道該怎么做.

I've seen this behavior before in an app call AllRecipes. I just don't know how to do it.

如何讓按圖標大小的分頁起作用?

How do I get paging on a per-icon sized basis to work?

推薦答案

嘗試讓你的滾動視圖小于屏幕的大小(寬度方向),但取消選中 IB 中的剪輯子視圖"復選框.然后,在其頂部覆蓋一個透明的 userInteractionEnabled = NO 視圖(全寬),覆蓋 hitTest:withEvent: 以返回您的滾動視圖.那應該給你你正在尋找的東西.有關詳細信息,請參閱此答案.

Try making your scrollview less than the size of the screen (width-wise), but uncheck the "Clip Subviews" checkbox in IB. Then, overlay a transparent, userInteractionEnabled = NO view on top of it (at full width), which overrides hitTest:withEvent: to return your scroll view. That should give you what you're looking for. See this answer for more details.

這篇關于以小于幀大小的增量分頁 UIScrollView的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)
主站蜘蛛池模板: 日韩久久中文字幕 | 91av视频在线观看 | 尤物视频在线免费观看 | 国产羞羞视频在线观看 | 国产精品色哟哟网站 | 成人网视频| 亚洲精品一二区 | 精品国产乱码久久久久久图片 | www.精品一区 | 欧美日韩欧美 | 欧美激情网站 | 精品成人佐山爱一区二区 | 久久久精品 | 久久久久久国产精品久久 | 久久精品色欧美aⅴ一区二区 | 国产精品s色 | 91一区二区三区 | 国产精品亚洲二区 | 久久久久久蜜桃一区二区 | 日本一级淫片免费啪啪3 | 久久免费高清 | 国产综合久久久久久鬼色 | 日韩一区中文字幕 | 亚洲一二三区精品 | 久久看精品 | 五月婷婷丁香婷婷 | 久久国产精品免费视频 | 91国自产 | 成人区精品 | 精品久久ai电影 | 亚洲成人www | 国内精品伊人久久久久网站 | 天天射影院| 羞羞网站免费观看 | 中文字幕成人在线 | 国产美女网站 | 一区二区欧美在线 | 欧美在线观看免费观看视频 | 久久99视频免费观看 | 欧美日韩在线高清 | 欧美一级毛片免费观看 |