Ok this one has me stumped.
I have a ScrollView with the content being a StackLayout called TabLayout. In code I'm adding another StackLayout as a child to TabLayout and this StackLayout contains an image, a label, some buttons, etc but for simplicity sake I've cut it right back to just having the image as it's only child.
When the view is rendered, there's big blank white space where that image should be, yet if I add the image as a child of TabLayout it appears perfectly fine.
XAML file:
<ScrollView x:Name="ScrollLayout" Orientation="Horizontal">
<StackLayout x:Name="TabLayout" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Orientation="Horizontal" Padding="20" />
</ScrollView>
Code-behind:
var browserImage = new Image()
{
Aspect = Aspect.AspectFit,
Source = "Splash/pricepal_splash_320x480.png",
VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalOptions = LayoutOptions.FillAndExpand,
};
var youStupidStupdLayout = new StackLayout()
{
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Children = { browserImage }
};
TabLayout.Children.Add(youStupidStupdLayout);
TabLayout.Children.Add(browserImage);
youStupidStupidLayout is just a big ole white blank square while the browserImage appears perfectly fine next to as the next child.
Any ideas?