Hello,
I have a frame with a stacklayout inside of a scrollview, when I open the page, labels and data show up, but only up to the bottom screen edge, everything after that gets cut (is simply blank). Tapping on a entry field makes the rest of the data and labels show up, but obviously that is undesirable behavior. I have tried changing the VerticalOptions and Grid definitions to multiple combinations, but nothing works.
Any ideas or suggestions as to how to solve this would be greatly appreciated.
Screenshot:
XAML:
<ContentPage.Content>
<ScrollView Orientation="Vertical">
<!-- only show the main content when loading is finished -->
<Grid Padding="10">
<!-- this frame is only visible when the page is loading its main data -->
<Frame
BackgroundColor="{AppThemeBinding White, Light={StaticResource Light_FrameBackground}, Dark={StaticResource Dark_FrameBackground}}"
CornerRadius="10"
Grid.Row="0" HorizontalOptions="FillAndExpand" HasShadow="False"
IsVisible="{Binding LoadingFinished, Converter={StaticResource boolInvert}}">
<StackLayout Orientation="Vertical" VerticalOptions="FillAndExpand">
<ActivityIndicator
Color="{AppThemeBinding Black, Light={StaticResource Light_TextOnFrame}, Dark={StaticResource Dark_TextOnFrame}}"
IsRunning="{Binding LoadingFinished, Converter={StaticResource boolInvert}}"
HorizontalOptions="Center" VerticalOptions="Center" />
<Label x:Name="loadingLabel" FontSize="Large"
Text="{x:Static resources:AppResources.InitLoadData}"
TextColor="{AppThemeBinding Black, Light={StaticResource Light_TextOnFrame}, Dark={StaticResource Dark_TextOnFrame}}"
HorizontalTextAlignment="Center" HorizontalOptions="Center" VerticalOptions="Center" />
</StackLayout>
</Frame>
<!-- the cool main frame, visible after the page finished loading its data -->
<Frame
BackgroundColor="{AppThemeBinding White, Light={StaticResource Light_FrameBackground}, Dark={StaticResource Dark_FrameBackground}}"
CornerRadius="22" Grid.Row="0" HasShadow="False" IsVisible="{Binding LoadingFinished}" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackLayout x:Name="mainFieldList" Grid.Row="0" Margin="0,5,0,5" Orientation="Vertical" HorizontalOptions="FillAndExpand">
<!-- the properties that come here are set in code -->
<Label Text="{x:Static resources:AppResources.SettingsPageEmailLabelText}"
TextColor="{AppThemeBinding Gray, Light={StaticResource Light_TextOnAppBackground}, Dark={StaticResource Dark_TextOnAppBackground}}"
FontSize="Medium" Margin="0,20,0,0" />
<Entry x:Name="EmailEntry" Text="{Binding UserMail}" Keyboard="Email" BackgroundColor="Transparent" IsEnabled="{Binding UserMailEnabled}"
TextColor="{AppThemeBinding Black, Light={StaticResource Light_TextOnAppBackground}, Dark={StaticResource Dark_TextOnAppBackground}}" />
<Label Text="{x:Static resources:AppResources.SettingsPageMobileNumberLabelText}"
TextColor="{AppThemeBinding Gray, Light={StaticResource Light_TextOnAppBackground}, Dark={StaticResource Dark_TextOnAppBackground}}"
FontSize="Medium" Margin="0,20,0,0" />
<Entry x:Name="MobileEntry" Text="{Binding Mobile}" Keyboard="Email" BackgroundColor="Transparent" IsEnabled="{Binding MobileEnabled}"
TextColor="{AppThemeBinding Black, Light={StaticResource Light_TextOnAppBackground}, Dark={StaticResource Dark_TextOnAppBackground}}" />
<Label Text="{x:Static resources:AppResources.AccountDataPageAddressLabelText}"
TextColor="{AppThemeBinding Gray, Light={StaticResource Light_TextOnAppBackground}, Dark={StaticResource Dark_TextOnAppBackground}}"
FontSize="Medium" Margin="0,20,0,0" />
<Entry x:Name="AddressEntry" Text="{Binding Address}" Keyboard="Email" BackgroundColor="Transparent" IsEnabled="{Binding AddressEnabled}"
TextColor="{AppThemeBinding Black, Light={StaticResource Light_TextOnAppBackground}, Dark={StaticResource Dark_TextOnAppBackground}}" />
<Label Text="{x:Static resources:AppResources.AccountDataPageFirstnameLabelText}"
TextColor="{AppThemeBinding Gray, Light={StaticResource Light_TextOnAppBackground}, Dark={StaticResource Dark_TextOnAppBackground}}"
FontSize="Medium" Margin="0,20,0,0" />
<Entry x:Name="FirstnameEntry" Text="{Binding Firstname}" Keyboard="Email" BackgroundColor="Transparent" IsEnabled="{Binding FirstnameEnabled}"
TextColor="{AppThemeBinding Black, Light={StaticResource Light_TextOnAppBackground}, Dark={StaticResource Dark_TextOnAppBackground}}" />
<Label Text="{x:Static resources:AppResources.AccountDataPageLastnameLabelText}"
TextColor="{AppThemeBinding Gray, Light={StaticResource Light_TextOnAppBackground}, Dark={StaticResource Dark_TextOnAppBackground}}"
FontSize="Medium" Margin="0,20,0,0" />
<Entry x:Name="LastnameEntry" Text="{Binding Lastname}" Keyboard="Email" BackgroundColor="Transparent" IsEnabled="{Binding LastnameEnabled}"
TextColor="{AppThemeBinding Black, Light={StaticResource Light_TextOnAppBackground}, Dark={StaticResource Dark_TextOnAppBackground}}" />
<Label Text="{x:Static resources:AppResources.AccountDataPageCountryLabelText}"
TextColor="{AppThemeBinding Gray, Light={StaticResource Light_TextOnAppBackground}, Dark={StaticResource Dark_TextOnAppBackground}}"
FontSize="Medium" Margin="0,20,0,0" />
<Entry x:Name="CountryEntry" Text="{Binding Country}" Keyboard="Email" BackgroundColor="Transparent" IsEnabled="{Binding CountryEnabled}"
TextColor="{AppThemeBinding Black, Light={StaticResource Light_TextOnAppBackground}, Dark={StaticResource Dark_TextOnAppBackground}}" />
<Label Text="{x:Static resources:AppResources.AccountDataPageCityLabelText}"
TextColor="{AppThemeBinding Gray, Light={StaticResource Light_TextOnAppBackground}, Dark={StaticResource Dark_TextOnAppBackground}}"
FontSize="Medium" Margin="0,20,0,0" />
<Entry x:Name="CityEntry" Text="{Binding City}" Keyboard="Email" BackgroundColor="Transparent" IsEnabled="{Binding CityEnabled}"
TextColor="{AppThemeBinding Black, Light={StaticResource Light_TextOnAppBackground}, Dark={StaticResource Dark_TextOnAppBackground}}" />
<Label Text="{x:Static resources:AppResources.AccountDataPageZippostalcodeLabelText}"
TextColor="{AppThemeBinding Gray, Light={StaticResource Light_TextOnAppBackground}, Dark={StaticResource Dark_TextOnAppBackground}}"
FontSize="Medium" Margin="0,20,0,0" />
<Entry x:Name="ZipEntry" Text="{Binding Zippostalcode}" Keyboard="Email" BackgroundColor="Transparent" IsEnabled="{Binding ZippostalcodeEnabled}"
TextColor="{AppThemeBinding Black, Light={StaticResource Light_TextOnAppBackground}, Dark={StaticResource Dark_TextOnAppBackground}}" />
</StackLayout>
<!-- save button and activity indicator -->
<Button x:Name="saveButton" Grid.Row="1" Clicked="OnSaveButtonClicked" IsVisible="True"
Text="{x:Static resources:AppResources.SaveButtonText}" BorderRadius="22"
BackgroundColor="{AppThemeBinding {StaticResource CommonGreen}, Light={StaticResource Light_GreenButtonAlternative}, Dark={StaticResource Dark_GreenButtonAlternative}}"
TextColor="{AppThemeBinding White, Light={StaticResource Light_TextOnButton}, Dark={StaticResource Dark_TextOnButton}}"
VerticalOptions="Center" FontSize="Small" />
<ActivityIndicator x:Name="activityIndicator" Grid.Row="1" IsVisible="false" IsRunning="false"
HorizontalOptions="Center" />
</Grid>
</Frame>
</Grid>
</ScrollView>
</ContentPage.Content>