Xamarin.Forms, Prism.Forms, Android Lolliop 5.1.1, Navigation transitions/animations

岁酱吖の 提交于 2020-01-07 05:31:06

问题


I have a problem when using Xamarin.Forms in conjunction with Prism.Forms (Unity) on an Android 5.1.1 (Lollipop) device.

Specifically, if I navigate to/from forms with "animation: true" those forms do not always work correctly afterward - specifically, the forms are not always updated in response to a PropertyChanged event. The forms work perfectly on Android 6.0 and 7.1 (the only other devices I have available for testing).

If I change all of my calls to INavigationService.NavigateAsync so that "animation" is false, those forms behave properly as long as I do not use the hardware "back" button to exit a form (as this then animates again). I have even created an override of the "UnityPageNavigationService" that overrides the "animated" parameter on calls to "DoPop", "DoPush" and "GoBackAsync" (I am pretty sure that the NavigateAsync method eventually calls one of these for all requirements except in the case of changing the content of a MasterDetailPage).

I am pretty sure that this is a Xamarin problem and not a Prism problem as having looked through the code on GitHub it appears to me that the Prism INavigationService implementation eventually comes back to the Page.Navigation.PushAsync(...) etc. methods and I am also pretty sure that the Prism navigation service is not intercepting the back button and interacting with it.

  • Is there any way to disable the animations when navigation is instigated by the hardware back button?

  • Is there a way to override the INavigation implementation for a platform (obviously Android in this instance)?

  • Is there a known issue and/or work-around here for Xamarin Forms on Lollipop 5.1.1?

I am using Xamarin Forms 2.3.4.231, Prism.Forms 6.3 and Prism.Unity.Forms 6.3.


回答1:


I eventually resolved this and it was nothing to do with Prism Navigation nor Xamarin.Forms but was instead caused by the element of the AndroidManifest.xml not being the first child of the element.

I had sorted the children of the element alphabetically making the last element and this broke it (though not on later versions of Android).



来源:https://stackoverflow.com/questions/43895960/xamarin-forms-prism-forms-android-lolliop-5-1-1-navigation-transitions-animat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!