Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
421 views
in Technique[技术] by (71.8m points)

ios - Supporting iPhone 6 and iPhone 6+ with different launch/splash screen image for iPad Portrait and Landscape orientations

What I understood from the available documentation and my testing is that

  1. All existing Apps on iPhone 6 and 6 Plus run in compatibility mode, which means the APIs (like [UIScreen mainScreen].bounds) will return 320x568 (iPhone 5/5s) still in new iPhones (6/6 Plus) and all UI is scaled to the correct resolution by iOS.

  2. To support iPhone 6/6Plus we need to create xib for Launch Screen (File->New->File->UserInterace->Launch Screen) and set the nib file as "Launch Screen File".

  3. We can set different images for launch screen inside Launch screen nib file based on avaialble size classes. [Basically combinations of Any, regular and compact]

  4. There is no way to differentiate between iPad in portrait and iPad in Landscape orientation (both are regular width regular height). Also there no way to differentiate between iPhone 4/4s and iPhone 5/s.

Is there a way I can support iPhone 6/6 Plus mode and also provide different launch images for iPad in portrait and iPad in landscape orientation?

See also the similar problem here iOS 8 size classes for iPad landscape

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You don′t have to use the launch screen file to make your App iPhone 6 / 6+ resolution compatible. Instead, you can select the LaunchImage asset as your Launch Images Source.

It can be found at "App Icons and Launch Images" under your Targets:

enter image description here

If there is no LaunchImage asset just go to your Images.xcassets, make a secondary click (right click) and select "New Launch Image":

enter image description here

The result is something like that:

enter image description here

Now just drag and drop your images for the specific resolutions you want to support and set the created LaunchImage asset as your source.

Hope it helps

Cheers


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...