2017-05-08 8 views

答えて

0

PopAsyncには、overrideがあり、アニメーション化する必要があるかどうかを示すブール値を受け取ります。 Navigation.PopAsync(true)を使用して呼び出すと、ページをポップするときにアニメーションが実行されます。

+0

ページがポップアップするときに左にアニメーションが必要です。 UIViewControllerのPopViewControllerメソッドをオーバーライドしたナビゲーションページのレンダラーを作成しています。 PopViewController – Pratik

0

あなたはAnimationPage代わりContentPageを作成https://github.com/AlexandrNikulin/AnimationNavigationPage素晴らしいライブラリ

使用

public class App : Application 
{ 
     public App() 
     { 
      MainPage = new AnimationNavigationPage(new YourHomePage()); 
     } 
} 

を試してみて、ViewModelにからXAMLまたはバインドにFadePageAnimationまたはPushPageAnimationまたはFlipPageAnimationなどのインスタンスを作成することができます。

<?xml version="1.0" encoding="UTF-8"?> 
<controls:AnimationPage xmlns="http://xamarin.com/schemas/2014/forms" 
     xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
     xmlns:controls="clr-namespace:FormsControls.Base;assembly=FormsControls.Base" 
     x:Class="Sample.FadeAnimationPage" 
     Title="Fade Animation"> 
     <controls:AnimationPage.PageAnimation> 
      <controls:FadePageAnimation /> 
     </controls:AnimationPage.PageAnimation> 
</controls:AnimationPage> 

それともContentPageためのインタフェースIAnimationPageを実装します。 EmptyPageAnimation、DefaultPageAnimation、FlipPageAnimationなどのインスタンスを作成します。

public partial class FirstPage : ContentPage, IAnimationPage 
{ 
     public FirstPage() 
     { 
      InitializeComponent(); 
     } 

     public IPageAnimation PageAnimation { get; } = new FlipPageAnimation { Duration = 650, Subtype = AnimationSubtype.FromLeft }; 
} 
+0

を使用せずに解決するコンポーネントはありません。 – Pratik

関連する問題