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

iOS 7——navigationController 正在設置我的 UIScrollVi

iOS 7 -- navigationController is setting the contentInset and ContentOffset of my UIScrollView(iOS 7——navigationController 正在設置我的 UIScrollView 的 contentInset 和 ContentOffset)
本文介紹了iOS 7——navigationController 正在設置我的 UIScrollView 的 contentInset 和 ContentOffset的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個 UIScrollView(實際上是一個 UICollectionView,但這可能無關緊要).當它出現在 IOS 7 中時,導航控制器將其 contentInset 和 contentOffset 設置為我不想要的值.它似乎正在嘗試調整狀態欄和導航欄.我非常希望它讓他們一個人呆著.我已經通過覆蓋 contentInset 和 contentOffset 的 getter 和 setter 方法來解決這個問題,并帶有一個標志來告訴對象它是否應該接受一個集合.但是有沒有更好的方法?

I have a UIScrollView (actually a UICollectionView, but that probably doesn't matter). When it appears in IOS 7, the navigation controller sets its contentInset and contentOffset to values I don't want. It appears to be trying to adjust for the status bar and the navigation bar. I'd greatly prefer it left them alone. I've fixed this by overriding the getter and setter methods for contentInset and contentOffset, with a flag to tell the object whether or not it should accept a set. But is there a better way?

推薦答案

嘗試在主視圖控制器中設置 self.automaticallyAdjustsScrollViewInsets = NO.

Try setting self.automaticallyAdjustsScrollViewInsets = NO in your main view controller.

這是在 iOS 7 中引入的,因此如果您支持 iOS 6 及更低版本,您可能需要使用 iOS 版本檢查來包裝它.

This was introduced in iOS 7 so you might want to wrap that with an iOS version check, if you are supporting iOS 6 and below.

更新

如果您使用情節提要,您可以在 Interface Builder 中執行此操作,也可以為您選擇的控制器選中 'Adjust Scroll View Insets'.

If you are using storyboards, you can do this in the Interface Builder as well as by checking 'Adjust Scroll View Insets' for your selected controller.

這篇關于iOS 7——navigationController 正在設置我的 UIScrollView 的 contentInset 和 ContentOffset的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)
主站蜘蛛池模板: 国产成人小视频 | 久久久成人免费一区二区 | 91精品一区二区三区久久久久久 | 波多野结衣先锋影音 | 在线观看精品视频网站 | 国产98色在线 | 日韩 | 国精产品一区一区三区免费完 | 色综合色综合网色综合 | 国产情品 | 国产精品久久片 | 国产一区二区三区四区 | 久久国产精品久久久久 | 99色播| 国产欧美日韩在线 | 视频一二区 | 欧美黑人巨大videos精品 | 91在线一区二区 | 日韩一二三区视频 | 国产精品免费一区二区三区四区 | 国产成人aⅴ | 亚洲欧美日韩国产综合 | av网站在线看 | 久久人人爽人人爽 | 亚洲一区二区在线播放 | 99热电影| 国产精品不卡 | 欧美色综合天天久久综合精品 | 九九热在线免费视频 | 91久久精品国产免费一区 | 草草草久久久 | 久久999 | 国产日韩精品视频 | 2018天天干天天操 | 青青草视频网站 | 999国产视频| 国产一级片免费在线观看 | 久久亚洲91 | 日韩在线不卡视频 | 久久国产一区二区三区 | 国产精品毛片 | 国产a视频 |