久久久久久久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)
主站蜘蛛池模板: 九一国产精品 | 国产欧美一区二区三区另类精品 | 日韩在线不卡视频 | 黄色一级特级片 | 日日淫| av黄色片在线观看 | h片在线观看网站 | 综合成人在线 | 黄色国产在线播放 | 91资源在线 | 二区三区视频 | 97国产超碰| 久久成人人人人精品欧 | 超碰人人在线 | 国产精品污www一区二区三区 | 9191成人精品久久 | 一区二区三区国产 | 狠狠久久久 | 日韩欧美在线观看 | 国产日韩中文字幕 | 影视一区| 国产黄色网 | 亚洲一区中文字幕在线观看 | 久久在看| 天堂网av在线 | 国产日韩欧美在线一区 | 偷拍自拍网 | 在线一区 | 国产这里只有精品 | 亚洲在线一区 | 精品国产一级 | 理伦毛片 | 久久综合影院 | 黑人精品xxx一区一二区 | 日韩一区不卡 | 日日夜夜天天 | 免费看的黄网站 | 日韩在线精品视频 | 日本高清视频网站 | 欧美日韩国产免费 | 一区二区三区中文字幕 |