久久久久久久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网站在线观看 | 91精品国产91久久久久久密臀 | a在线视频 | 青青草久久 | 欧美成人一区二区三区 | 精品久久久久久亚洲综合网 | 日本视频免费 | 国产精品www | 国产一级片免费在线观看 | 在线看片国产 | 亚洲国产精品精华素 | 人人干人人超 | av网站在线看 | 亚洲91| 99久久精品国产毛片 | 欧美成人a∨高清免费观看 欧美日韩中 | 亚洲狠狠爱 | 黄色成人免费在线观看 | 国产成人亚洲精品自产在线 | 午夜精品福利视频 | 亚洲一区二区 | 国产精品中文字幕一区二区三区 | 伊人性伊人情综合网 | 色.com| 高清视频一区二区三区 | 一级毛片视频在线 | 国产精品久久久久久久久久久久冷 | 亚洲精品久久久久久久久久吃药 | 日韩www视频 | 日韩在线看片 | 久久国产精品一区 | 99久久国产免费 | 午夜精品视频一区 | 日本视频在线播放 | 天天综合网7799精品 | 国产精品黄色 | 日韩av啪啪网站大全免费观看 | 婷婷色国产偷v国产偷v小说 |