iOS13适配汇总(推荐)-创新互联-古蔺大橙子建站
RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
iOS13适配汇总(推荐)-创新互联

随着iPhone 11的发布,iOS 13适配也提上了日程,接下来就开发中升级iOS13的手机可能出现的问题

创新互联建站是专业的亳州网站建设公司,亳州接单;提供成都网站设计、成都做网站,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行亳州网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

Xcode: 11.0
iOS : 13.0

UIViewController 模态弹出界面

viewController.present(presentVC, animated: true, completion: nil)

在调用模态弹出视图,会发现弹出的界面没有全屏。如图

iOS 13适配汇总(推荐)

通过多次的尝试,发现在低版本里面不会发生这种情况(iOS12及以下),于是我查阅了最新的开发文档,发现了端倪,主要还是因为我们之前忽略了UIViewController里面的一个属性,即: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
}

另外有需要云服务器可以了解下创新互联建站www.cdcxhl.com,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网页题目:iOS13适配汇总(推荐)-创新互联
本文网址:http://scgulin.cn/article/doohci.html