简体   繁体   中英

How to set LaunchScreen image width constraint to superview in xamarin iOS project storyboard file?

I am implementing a 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 the steps to set an imageview width to its super view (View controller) .

I see what I should do from here, Visual studio Xamarin iOS launchscreen storyboard layout . But, how do I add those constraints, totally no idea..?! Particularly imageview width and height to superview, trailing and leading

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). There is no button to add constraints. How to add leading and trailing constraints? I'm using Visual Studio 2017 for Windows

I got it working.

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.

This will be very useful for important UI auto designs like splash screen.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM