Harsh.C
Harsh.C

Reputation: 83

Set UIImage to cover the screen for all device screens, xib file

I have a view controller and the UI for the view controller is represented through a xib file instead of main.storyboard. Here is how it looks like. As you can see I have an UIImage view that acts as a background image and is suppose to cover the whole screen.

I am trying to add four constraints: Make all four spacing to the nearest neighbors equal to 0. But when I use the pin constraint option and set pin all sides to 0, it doesn't make the spacing to the nearest neighbor zero but gives me the following four constraints:

enter image description here

So then I tried to control drag from the uiimage to the edge of the frame but I can't do that either. How can I solve this issue?

Also forgot to mention an important thing. When I run the app there are black spaces in the top and bottom of the screen. So the UIImage does not cover the whole screen. Here is a picture while the app is running:

enter image description here

Upvotes: 0

Views: 161

Answers (1)

Kishore Kumar
Kishore Kumar

Reputation: 4375

Your problem is launchscreen.

You need to check the launchscreen ,if it is not in correct format or there is no launchscreen means this kind of problem will occurs .

Upvotes: 1

Related Questions