Add iPhone X layout support to old Xcode 7 / Swift 2 project

和自甴很熟 提交于 2019-12-25 01:34:07

问题


What I have?

An old project using Swift 2 and building/running without any issue on Xcode 7. It has a lot of dependencies and sophisticated architecture which makes it complicated to migrate to swift 3/4 (in a short period of time).

When app is running on iPhone X it has black bars on top and bottom of the sreen (sizing like on iPhone 6/7/8)

What I need?

I need to make the app running on iPhone X without black bars on top and bottom of the screen (fullscreen) without updating whole project. Are there any ways making it possible?

What I've tried?

  • Making constraints directly to the containing superviews and not the layoutGuide
  • Removing launchScreen assets and sticking only to LaunchScreen.xib

回答1:


There are only two ways to remove black bars for a newer device size:

  • Launchscreen images assets with the new size
  • Launchscreen storyboard

And, well, you're out of luck, because both solutions require Xcode 9 for iPhone X size support. So you must go for Swift 3.2 at least.



来源:https://stackoverflow.com/questions/48608643/add-iphone-x-layout-support-to-old-xcode-7-swift-2-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!