UIModalTransitionStyle horizontal movement

前端 未结 1 1968
囚心锁ツ
囚心锁ツ 2021-01-07 04:41

The UIModalTransitionStyle is either Vertical, Flip or Dissolve. I would like it to be right to left or left to right, like if you click on a disclosure button on a MapKit c

1条回答
  •  有刺的猬
    2021-01-07 05:10

    This is impossible as transition for a modal viewController, but you could use a CATransition with a type of kCATransitionMoveIn or kCATransitionPush and a subtype of kCATransitionFromRight

    CATransition* trans = [CATransition animation];
    trans.type = kCATransitionPush;
    trans.subtype = kCATransitionFromRight;
    trans.duration = 0.5;
    
    [newView.layer addAnimation:trans forKey:@"PushFromRightEffect"];
    
    [someOtherView addSubview:newView];
    // Coded in Browser not tested
    

    0 讨论(0)
提交回复
热议问题