c# - How to use UIViewControllerTransitioningDelegate with MvxIosViewPresenter? -


i have view controller a , view controller b , want navigate a b (present modally) custom transition (uiviewcontrollertransitioningdelegate), how mvxiosviewpresenter?

do need write custom presenter myself or there way how in elegant way?

it possible use custom transition mvxiosviewpresenter. have create custom uiviewcontrollertransitioningdelegate , assign viewcontroller (viewdidload place it).

something should work:

[mvxmodalpresentation(modalpresentationstyle = uimodalpresentationstyle.overfullscreen, modaltransitionstyle = uimodaltransitionstyle.crossdissolve)] public partial class modalview : mvxviewcontroller<modalviewmodel> {     public modalview(intptr handle) : base(handle)     {     }      public override void viewdidload()     {         base.viewdidload();          transitioningdelegate = new transitioningdelegate();     } }  public class transitioningdelegate : uiviewcontrollertransitioningdelegate {     public override iuiviewcontrolleranimatedtransitioning getanimationcontrollerforpresentedcontroller(uiviewcontroller presented, uiviewcontroller presenting, uiviewcontroller source)     {         return new customtransitionanimator();     } }  public class customtransitionanimator : uiviewcontrolleranimatedtransitioning {     public override double transitionduration(iuiviewcontrollercontexttransitioning transitioncontext)     {         return 1.0f;     }      public override void animatetransition(iuiviewcontrollercontexttransitioning transitioncontext)     {         var inview = transitioncontext.containerview;         var tovc = transitioncontext.getviewcontrollerforkey(uitransitioncontext.toviewcontrollerkey);         var toview = tovc.view;          inview.addsubview(toview);          var frame = toview.frame;         toview.frame = cgrect.empty;          uiview.animate(transitionduration(transitioncontext), () =>         {             toview.frame = new cgrect(10, 10, frame.width - 20, frame.height - 20);         }, () =>         {             transitioncontext.completetransition(true);         });     } 

}


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -