2017-10-20 59 views
0

我正在使用MVVMCross5 for Android。我沒有與片段導航問題,但片段動畫無法正常工作。我在片段定義上的MvxFragmentPresentation屬性上使用EnterAnimation屬性。我錯過了什麼?以下是我的片段定義:EnterAnimation無法正常工作MvxFragment

[MvxFragmentPresentation(ActivityHostViewModelType = typeof(MainViewModel), FragmentContentId = Resource.Id.frame_layout, AddToBackStack = true, EnterAnimation = Android.Resource.Animation.SlideInLeft)] 
public class LabelRequestDetailFragment : BaseFragment<LabelRequestDetailViewModel> 
{ 
    public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) 
    { 
     base.OnCreateView(inflater, container, savedInstanceState); 
     return this.BindingInflate(Resource.Layout.label_request_detail, null); 
    } 
} 

回答

2

您需要同時設置EnterAnimation和ExitAnimation以使其工作。

This在源代碼行中進行檢查。

此限制的原因是Android SDK需要兩個參數。

+0

謝謝。它在設置EnterAnimation和ExitAnimation資源之後起作用,但現在只顯示輸入動畫但不退出動畫。 –