You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm facing a very strange behavior with modal navigation, in brief, the modal pages are shown in FullScreen instead of Automatic (PageSheet).
I understand that by default in iOS 13+ the default ModalPresentationStyle is setted to Automatic which internally is translated to PageSheet and that is the behavior I expect when navigating to a modal page, but that is not happening in my App.
This behavior is very strange, I've traced the problem creating a NavigationRenderer, basically there I'm handling the WillMoveToParentViewController(UIViewController parent) event.
The first time the event is triggered (when showing the MainPage) the value for parent.ModalPresentationStyle is UIModalPresentationStyle.PageSheet as expected, but the second time (when I launch the navigation to a modal page) it has changed to UIModalPresentationStyle.FullScreen
I'm not really sure if this is a bug or something I'm doing wrong, but as this is happening when navigating I think maybe here someone could provide me some guidance.
My Setup:
My 3 projects (Shared, Android and iOS) all are using latest (at this time) Xamarin.Forms package which is 4.5.0.617 and in the shared (.net standard) project I'm referencing latest nuget package for FreshMvvm 3.0.0.
For testing and reproducing this I'm using only devices and simulators running iOS 13.4 and 13.4.1, mainly iPhone 11 and PRO MAX.
A short version of my code here:
App.xaml.cs
public App()
{
InitializeComponent();
var loginPage = FreshPageModelResolver.ResolvePageModel<LoginPageModel>();
var loginNavContainer = new FreshNavigationContainer(loginPage);
MainPage = loginNavContainer;
}
public class NavigationPageRenderer : NavigationRenderer
{
public override void WillMoveToParentViewController(UIViewController parent)
{
if(parent != null)
{
parent.ModalPresentationStyle = UIModalPresentationStyle.Automatic;
}
}
}
My not-so-fancy fix is to use the NavigationRenderer to change the Style on the fly (and works!), but I would like to understand what is really happening here.
Note: This "error" is even happening with the Sample App attached here in the repo.
The text was updated successfully, but these errors were encountered:
I'm facing a very strange behavior with modal navigation, in brief, the modal pages are shown in FullScreen instead of Automatic (PageSheet).
I understand that by default in iOS 13+ the default ModalPresentationStyle is setted to Automatic which internally is translated to PageSheet and that is the behavior I expect when navigating to a modal page, but that is not happening in my App.
This behavior is very strange, I've traced the problem creating a NavigationRenderer, basically there I'm handling the WillMoveToParentViewController(UIViewController parent) event.
The first time the event is triggered (when showing the MainPage) the value for parent.ModalPresentationStyle is UIModalPresentationStyle.PageSheet as expected, but the second time (when I launch the navigation to a modal page) it has changed to UIModalPresentationStyle.FullScreen
I'm not really sure if this is a bug or something I'm doing wrong, but as this is happening when navigating I think maybe here someone could provide me some guidance.
My Setup:
My 3 projects (Shared, Android and iOS) all are using latest (at this time) Xamarin.Forms package which is 4.5.0.617 and in the shared (.net standard) project I'm referencing latest nuget package for FreshMvvm 3.0.0.
For testing and reproducing this I'm using only devices and simulators running iOS 13.4 and 13.4.1, mainly iPhone 11 and PRO MAX.
A short version of my code here:
App.xaml.cs
LoginPageModel.cs
NavigationPageRenderer.cs
My not-so-fancy fix is to use the NavigationRenderer to change the Style on the fly (and works!), but I would like to understand what is really happening here.
Note: This "error" is even happening with the Sample App attached here in the repo.
The text was updated successfully, but these errors were encountered: