iPhone Pushing View Controller in a left direction

前端 未结 6 1597
耶瑟儿~
耶瑟儿~ 2020-12-05 12:07

I have an app that has a centre view with two views off to each side of it. I want to have two navigation bar buttons, left and right which push a new navigation controller

6条回答
  •  青春惊慌失措
    2020-12-05 12:49

    Instead of using a navigation controller, I would just move the view.

    CGRect inFrame = [currentView frame];
    CGRect outFrame = firstFrame;
    outFrame.origin.x -= inFrame.size.width;
    
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:1.0];
    
    [newView setFrame:inFrame];
    currentView setFrame:outFrame];
    
    [UIView commitAnimations];
    

提交回复
热议问题