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

Horizontal stack layout with a label and a slider, how to vertically centre label & slider to fill

$
0
0

Hi guys,
Im trying to use a horizontal stack layout to setup a label and a slider inside a cell. I can get them to appear, but the label is aligned to the top and not entered vertically, and nothing I seem to be able to do to get the slider to fill the remaining space. Code:

var stack = new StackLayout
            {
                Padding = new Thickness (15, 0, 15, 0),
                Orientation = StackOrientation.Horizontal,
                VerticalOptions = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.StartAndExpand,
                Children = { label, slider }
            };

Doesn't need to be a stack layout if there is a better way of doing this. I just want a label and slider on the same line that sizes correctly when rotated.

Any pointers?
John


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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