Reputation: 265
I make App with xamarin in VS2015.
I add contentPage with App.Current.MainPage.Navigation.PushModalAsync,
and if tap hardware's back key, Navigator working popModalAsync with animation.
how change animation(no animation) if I touch Physical backKey in android?
Upvotes: 0
Views: 90
Reputation: 2981
I'm unsure whether or not I fully understand the question but you could simply call PopModalAsync(false)
which disables the animation. The call without this parameter always uses the animation.
UPDATE:
Each Xamarin Forms page has an override called OnBackButtonPressed
. You could override this to add your custom behavior. Something like this:
protected override bool OnBackButtonPressed ()
{
PopModalAsync(false);
return true;
}
You have to make OnBackButtonPressed return true in order to block the default behavior.
Upvotes: 1