0
我試圖關閉彈出和推送頁面的所有動畫。我做了一個自定義的渲染器:Xamarin表單:iOS上沒有動畫的導航彈出
[assembly: ExportRenderer(typeof(NavigationPage), typeof(CustomNavigationPageRenderer))]
namespace MyNamespace
{
public class CustomNavigationPageRenderer : NavigationRenderer
{
protected override Task<bool> OnPushAsync(Page view, bool animated)
{
return base.OnPushAsync(view, false);
}
protected override Task<bool> OnPopViewAsync(Page page, bool animated)
{
return base.OnPopViewAsync(page, false);
}
protected override Task<bool> OnPopToRoot(Page page, bool animated)
{
return base.OnPopToRoot(page, false);
}
}
推送工作完美,從不顯示動畫。同樣的渲染器也可以在Android上完美運行。但OnPopViewAsync始終在彈出窗口後調用,因此會顯示動畫。我正在使用Xamarin.Forms v2.3.0.46-pre3。是否有其他人遇到這個問題並找到解決方法?在CustomNavigationPageRenderer