Visual studio Xamarin iOS launchscreen storyboard

2019-08-23 00:15发布

I can't seem to wrap my head around how the storyboard editor in Visual Studio works. My design department has provided me with some images to be used as the splash screen of our App, and I'm to put them in the launchscreen.storyboard and align the correctly. However, the whole editor doesn't make any sense to me. I've been reading about constraints, and trying them out in Visual Studio, but the system doesn't seem to do anything I want. It's always doing something else than I was expecting.

The launchscreen consists of three images. The first is a background, it should fill the entire screen. The second one is a footer. It should be shown at the bottom of the screen, with fixed margins to the left, right and bottom, showing it in the correct aspect ratio. The third is an icon that should be shown in the center with a fixed left and right margin. How can I go about this? Is there anyone who can point me to an example? Or who can explain the required constraints to me?

1条回答
We Are One
2楼-- · 2019-08-23 01:08

You should be aware of that all the constraints set on the control determine its position(x,y) and size(width,height).

First one

fill the entire screen

top ,leading, trailing,bottom margin to superview euqals to 0.

enter image description here

Second one

at the bottom of the screen, with fixed margins to the left, right and bottom, showing it in the correct aspect ratio

fixed leading , trailing , bottom margin to superview , and aspect ratio plus.

enter image description here

Third one

shown in the center with a fixed left and right margin

Here the constraints are insufficient, the image can't know its height, we should set a fixed height or aspect ratio on height.

enter image description here


PS (about how to set aspect ratio)

click the height handle and aspect ratio enter image description here

double click the height constraint in Layout menu. enter image description here

modify the multiplier.

enter image description here

查看更多
登录 后发表回答