I am using a horizontal scrollview to display a horizontal list of small icons.
However a label placed underneath the scrollview is displaced to the bottom of the screen.
I want the label to be immediately underneath the scrollview, which should place it near to the top of the screen.
I always think that an image is worth a thousand words, so below is a test, where the label "Test: 25 March" is at the bottom of the screen,
instead of being just under the 'Home' button.
Thanks for any thoughts,
Russ
` var horizontalstack = new StackLayout
{
Spacing = 0,
Orientation = StackOrientation.Horizontal,
HorizontalOptions = LayoutOptions.Start,
VerticalOptions = LayoutOptions.Start
};
var horizontalScrollView = new ScrollView
{
Content = horizontalstack,
Orientation = ScrollOrientation.Horizontal,
HorizontalOptions = LayoutOptions.Start,
VerticalOptions = LayoutOptions.Start
};
var homeButton = new Button
{
Text = "Home",
Font = Font.SystemFontOfSize(18),
TextColor = Color.Yellow,
BackgroundColor = Color.Black
};
var inviteButton = new Button
{
Text = "+",
Font = Font.SystemFontOfSize(18),
TextColor = Color.Red,
BackgroundColor = Color.Black
};
horizontalstack.Children.Add(homeButton);
horizontalstack.Children.Add(inviteButton);
var queryLabel = new Label
{
Text = "Why at bottom?",
BackgroundColor = Color.Red,
TextColor = Color.Black,
Font = Font.BoldSystemFontOfSize(20),
};
var mainStack = new StackLayout
{
Spacing = 0,
Orientation = StackOrientation.Vertical
};
mainStack.Children.Add(horizontalScrollView);
mainStack.Children.Add(queryLabel);
Content = mainStack;
`