質問

So, the question: Is there any way to use a simple .xib or something like it, to have a splash screen with just a solid background extending the full width and height of the screen with a single, centered image?

I'm just learning iOS development and Objective-C. I'm trying to find a simpler way of creating a splash screen for an app without using the traditional loading images.

Why? In android development, I can use a fragment as a splash screen and place a single image at the center on a colored background. This will scale for ANY screen size, in ANY orientation.

In iOS development, they want me to create multiple image files for every orientation and screen size. This is not very scalable. If the logo or design changes, every one of these files has to be recreated and added again to the app.

役に立ちましたか?

解決

You need to understand that the launch image Apple requires you to include is not for the purpose of being a splash screen. It is there to make the transition from the launchpad into the splash screen smooth. Yeah, it doesn't scale well, but it's just one image - you can handle it.

I don't know how to do it using auto layouts, but the old school way would be to place a UIImageView in the centre of the view set its autoresizingMask property to UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight. In Interface Builder it would look like this: using autoresizingMask in IB

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top