隨著iPhone 11的發(fā)布,iOS 13適配也提上了日程,接下來就開發(fā)中升級(jí)iOS13的手機(jī)可能出現(xiàn)的問題
Xcode: 11.0
iOS : 13.0
UIViewController 模態(tài)彈出界面
viewController.present(presentVC, animated: true, completion: nil)
在調(diào)用模態(tài)彈出視圖,會(huì)發(fā)現(xiàn)彈出的界面沒有全屏。如圖
通過多次的嘗試,發(fā)現(xiàn)在低版本里面不會(huì)發(fā)生這種情況(iOS12及以下),于是我查閱了最新的開發(fā)文檔,發(fā)現(xiàn)了端倪,主要還是因?yàn)槲覀冎昂雎粤?strong>UIViewController里面的一個(gè)屬性,即:modalPresentationStyle
Defines the presentation style that will be used for this view controller when it is presented modally. Set this property on the view controller to be presented, not the presenter. If this property has been set to UIModalPresentationAutomatic, reading it will always return a concrete presentation style. By default UIViewController resolves UIModalPresentationAutomatic to UIModalPresentationPageSheet, but other system-provided view controllers may resolve UIModalPresentationAutomatic to other concrete presentation styles. Defaults to UIModalPresentationAutomatic on iOS starting in iOS 13.0, and UIModalPresentationFullScreen on previous versions. Defaults to UIModalPresentationFullScreen on all other platforms. public enum UIModalPresentationStyle : Int { case fullScreen @available(iOS 3.2, *) case pageSheet @available(iOS 3.2, *) case formSheet @available(iOS 3.2, *) case currentContext @available(iOS 7.0, *) case custom @available(iOS 8.0, *) case overFullScreen @available(iOS 8.0, *) case overCurrentContext @available(iOS 8.0, *) case popover @available(iOS 7.0, *) case none @available(iOS 13.0, *) case automatic }
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)建站www.cdcxhl.com,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。