Push problem rotation
rudacs opened this issue · comments
Rudá Cunha commented
I'm having a problem with Push animation only.
When pushing and rotating and returning, the screen does not return to the correct position.
The same is true when rotating, pushing and returning, the screen does not return to the correct position.
In other animations this problem does not occur.
Below is the code and a gif showing the problem.
using FormsControls.Base;
using Xamarin.Forms;
namespace test
{
public class App : Application
{
public App()
{
MainPage = new AnimationNavigationPage(new Page1());
}
}
public class Page1 : ContentPage
{
public Page1()
{
Title = "Page 1...";
Content = new Label()
{
Text = "PushPageAnimation",
FontSize = 20,
Margin = 15,
TextColor = Color.White,
BackgroundColor = Color.Blue,
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalTextAlignment = TextAlignment.Center,
VerticalTextAlignment = TextAlignment.Center
};
Content.GestureRecognizers.Add(new TapGestureRecognizer()
{
Command = new Command(x => Navigation.PushAsync(new Page2()))
});
}
}
public class Page2 : ContentPage, IAnimationPage
{
public Page2()
{
Title = "Page 2...";
Content = new Label()
{
Text = "Page 2",
FontSize = 20,
Margin = 15,
TextColor = Color.White,
BackgroundColor = Color.Green,
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalTextAlignment = TextAlignment.Center,
VerticalTextAlignment = TextAlignment.Center
};
Content.GestureRecognizers.Add(new TapGestureRecognizer()
{
Command = new Command(x => Navigation.PopAsync())
});
}
public virtual IPageAnimation PageAnimation => new PushPageAnimation { Duration = AnimationDuration.Short, Subtype = AnimationSubtype.FromTop };
public void OnAnimationFinished(bool isPopAnimation)
{
}
public void OnAnimationStarted(bool isPopAnimation)
{
}
}
}
Prateek Mahendrakar commented
@rudacs is it only on iOS . i couldnt reproduce it on Android