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

iOS 7——navigationController 正在設(shè)置我的 UIScrollVi

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

問題描述

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

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?

推薦答案

嘗試在主視圖控制器中設(shè)置 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.

更新

如果您使用情節(jié)提要,您可以在 Interface Builder 中執(zhí)行此操作,也可以為您選擇的控制器選中 '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.

這篇關(guān)于iOS 7——navigationController 正在設(shè)置我的 UIScrollView 的 contentInset 和 ContentOffset的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

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(以編程方式設(shè)置 contentOffset 觸發(fā) scrollViewDidScroll)
Photos app-like gap between pages in UIScrollView with pagingEnabled(使用 pagingEnabled 的 UIScrollView 中頁面之間的照片應(yīng)用程序式間隙)
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手机天堂网 | 日韩高清一区 | 亚洲在线 | 中文毛片| 国产成人精品一区二 | 久久av片| 欧美日韩精品久久久免费观看 | 欧美日韩a| 老司机免费福利视频 | 精品国产区一区二 | 国产盗摄一区二区三区 | 亚洲免费成人 | 色一情一乱一伦一区二区三区 | 视频一二区 | 色播五月婷婷 | 成人国产一区 | 国产a久久麻豆入口 | 欧美伊人久久 | 97色在线 | 国产一区二区中文字幕 | 一区二区免费 | 欧美视频一区二区 | 亚洲高清在线观看 | 亚洲网在线 | 久草网在线 | 国产精品一区三区 | 黄色特级片 | 啪啪综合网 | 黑人巨大猛烈捣出白浆 | 欧美日韩在线精品 | 亚洲影视一区 | 国产在线视频一区二区 | 欧美激情在线观看 | 青青青视频在线 | 五月天婷婷社区 | 国产精品观看 | 综合五月 |