Showing pushviewcontroller animation look like presentModalViewController

后端 未结 5 779
时光说笑
时光说笑 2020-11-29 18:05

Is it possible to show pushViewController animation look like presentModalViewController but that has background functionality of pushViewCon

5条回答
  •  天涯浪人
    2020-11-29 18:07

    You should consider doing something like:

    ViewController *myVC = [[ViewController alloc] initWithFrame:OFF_SCREEN];
    [navigationController pushViewController:myVC animated:NO];
    

    where OFF_SCREEN is some CGRect below the screen, like (0, 481, 320, 480). Then use an animation block to adjust the viewcontroller's view's frame.origin to be (0, 0). You would probably want to do the animate block in viewDidLoad or viewDidAppear.

提交回复
热议问题