Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 81910

Showing one label at Start, another at Center in one StackLayout

$
0
0

var masterStackLayout = new StackLayout();
masterStackLayout.Children.Add(new Label
{
    Text = "Top",
    VerticalOptions = LayoutOptions.Start,
    HorizontalTextAlignment = TextAlignment.Center
});
masterStackLayout.Children.Add(new Label
{
    Text = "Center",
    VerticalOptions = LayoutOptions.Center,
    HorizontalTextAlignment = TextAlignment.Center
});
Content = masterStackLayout;

I was expecting one of the Label to be at the top of the page, another Label to be at the center of the page. The result is that both Label shows up at the top of the page.

What am I doing wrong?


Viewing all articles
Browse latest Browse all 81910

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>