iOS Storyboard - LaunchScreen image width constraint to superview

paul_macpaul_mac Member ✭✭

Hello everyone! I'm working on splash screen for my app. I just came to know about storyboard constraints to support multiple devices. Basically, I feel it very difficult to understand it as a beginner in this, also I see there is no apt documentation in xamarin also. I want to know how to set an imageview width to its super view (View controller). Now, I can only know how to set the constraints in designer by dragging, I'v only learnt to center the image to super view in X and Y (Horizontally and vertically) Then, I also want a good complete reference on how to add storyboard constraints in Visual Studio for Windows. I am using Xamarin.Forms project. NOTE: I have the image source from image assets, is that correct? Please assist.. Thanks in advance.

Best Answer

  • paul_macpaul_mac ✭✭
    Accepted Answer

    Thank you JESUS for answering my prayer..!

    Check here https://stackoverflow.com/a/55664524/10329199 for my answer..

    Step 1: Open storyboard file with lowest screen resolution device set (iPhone 4s) and drag & drop an imageview to fill the view controller.

    Step 2: Set the uiimageview source from resources/image assets.

    Step 3 : Click on the image -> Properties Tab -> Layouts section. You will see like this

    Step 4 : Properties -> Layout -> Under View group, there is title called Arrange, there is a autosizing box and example box.

    Step 5 : You should click all the I-bars and lines in the center to make it red like below to fill the width (you can see that reflecting in the example box as you click)

    Now, SAVE and then switch to other devices, you should have that UIImageview filling the device's height and width..

    Hope this will be very useful for beginners and important UI auto designs like splash screen.

Answers

  • paul_macpaul_mac Member ✭✭
    Accepted Answer

    Thank you JESUS for answering my prayer..!

    Check here https://stackoverflow.com/a/55664524/10329199 for my answer..

    Step 1: Open storyboard file with lowest screen resolution device set (iPhone 4s) and drag & drop an imageview to fill the view controller.

    Step 2: Set the uiimageview source from resources/image assets.

    Step 3 : Click on the image -> Properties Tab -> Layouts section. You will see like this

    Step 4 : Properties -> Layout -> Under View group, there is title called Arrange, there is a autosizing box and example box.

    Step 5 : You should click all the I-bars and lines in the center to make it red like below to fill the width (you can see that reflecting in the example box as you click)

    Now, SAVE and then switch to other devices, you should have that UIImageview filling the device's height and width..

    Hope this will be very useful for beginners and important UI auto designs like splash screen.

Sign In or Register to comment.