Slightly odd one. I have built an app in Xamarin Forms (Shell) and everything works fine on Android. When I navigate to a new page in ios (iphone 11 pysical device), the screen seems to pop down and resize. I think this is related to the safe area property used in the views that is happening a little bit too slow as it appears to be in the safe areas and then resizes to be in the safe zone.
No impact on Android.
I can't recreate in a new project but my current project has significant time investment and i don't want to start again... I can't retro fit into my existing project, the problem persists.
Some example code below, but the weird bit is that it seems to work in a new project so im looking for guidance on what else might be set somewhere to debug this issue. Any thoughts? Can provide additional code examples as needed, just let me know.
I've tried upgrading and downgrading packages etc no effect.
Packages
I navigate using
private async Task ExecuteAddPageCommand()
{
await PushAsync(new AddPagePage());
}
where PushAsync is in my baseviewmodel
public async Task<bool> PushAsync(Page page)
{
try
{
await Shell.Current.Navigation.PushAsync(page);
return true;
}
catch
{
await Shell.Current.GoToAsync(Utilities.Routes.ErrorModalPage);
return false;
}
}
And the pages have the standard properties (example)
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
ios:Page.UseSafeArea="true"
Visual="Material"
x:Class="namespace:Thing.Views.AddPage"
xmlns:converter="clr-namespace:Thing.Converters"
xmlns:controls="clr-namespace:Thing.Controls"
xmlns:utilities="clr-namespace:Thing.Utilities"
>
<ContentPage.Resources>
<ResourceDictionary>
<converter:IntToEnumConverter x:Key="IntToEnum"/>
<converter:InverseBoolConverter x:Key="InverseBool"/>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"></RowDefinition>
<RowDefinition Height="5*"></RowDefinition>
<RowDefinition Height="1*"></RowDefinition>
</Grid.RowDefinitions>
<controls:PageHeader Grid.Row="0" ShowBackButton="true"
HeaderTitle="New Thing"
HeaderImage="{x:Static utilities:Icons.AddMenuIcon}"
BackCommand="{Binding NavigateBackCommand}"/>
<StackLayout Grid.Row="1">
<Label Text="What do you want to call this?" Style="{StaticResource FormLabel}"/>
<Entry Text="{Binding Name.Value}" Placeholder="E.g. My shiny thing"/>
</StackLayout>
<StackLayout Grid.Row="2" Orientation="Horizontal">
<Button HorizontalOptions="FillAndExpand" Text="Cancel" Command="{Binding NavigateBackCommand}"></Button>
<Button HorizontalOptions="FillAndExpand" Text="Save" Command="{Binding SaveCommand}"></Button>
</StackLayout>
</Grid>
</ContentPage.Content>
</ContentPage>
I had the exact same problem and updating to the latest (4.8.1269) did not help. It seems this problem was introduced in 4.7.1260. I downgraded to 4.7.1239 and all is well again.