Stack layouts
Stack layouts allow you to stack one control on top of another or next to one another. They come in three flavors:
StackLayout
VerticalStackLayout
HorizontalStackLayout
The first of these is for backward compatibility with Xamarin.Forms
and is effectively deprecated; the other two are far more performant.
We’ve seen VerticalStackLayout
and HorizontalStackLayout
at work already. As the name indicates, VerticalStackLayout
places one control on top of another, while HorizontalStackLayout
places them side by side. Using margins
(the space between objects) and padding
(the space around an object), you can tweak a nice enough layout with just these controls:
<VerticalStackLayout x:Name="LoginStackLayout"> <HorizontalStackLayout WidthRequest="300"> <Label Style="...