Visual studio Xamarin iOS launchscreen storyboard layout

左心房为你撑大大i 提交于 2019-12-25 12:54:14

问题


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:


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.

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.

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.


PS (about how to set aspect ratio)

click the height handle and aspect ratio

double click the height constraint in Layout menu.

modify the multiplier.



来源:https://stackoverflow.com/questions/48209563/visual-studio-xamarin-ios-launchscreen-storyboard-layout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!