Home > front end >  iOS how to expand Image View to borders in Launch Screen?
iOS how to expand Image View to borders in Launch Screen?

Time:11-03

I am 2 days into iOS app development, I am quite new. The very first thing I wanted to implement in my app is a Launch Screen using Storyboards (I heard there are other ways but I found this the easier). I have a vector-based PDF file (image) because I wanted to implement a gradient background without a loss in quality that supports all device resolutions.

I created an Image View in the Interface-Builder (IB) but it does not automatically stretch vertically and horizontally to fill the device length.

  • I simulate my results on an iPhone 14, only thin white margins appear, but on a large iPad, the majority of the screen is white. It's like as if the the image resolution is fixed across all devices.

No matter what resizing I try, I can't get it to work.

I come from an Android app development background so something like this is very easy to implement (we have fill_parent / match_parent to stress the view to its containing parent view dimensions). Is such a behavior possible on iOS ?

CodePudding user response:

You have to apply constraint on the image in launch screen. enter image description here

  • Related