简体   繁体   中英

Keep UIView while animating navController

How can I animate in a new uinavigation controller but keep the same uiview in the window?

I've seen this done in the opposite - a navController stay in place while a container view changes a view controller as a child view controller, but I want the opposite:a main view, a mapview, to remain in the window at all times while a new vc2 slides in from a push segue which will show a different navBar title and uibarbutton items. This is important because I need the mapview from VC1 to replicate in VC2, or to that effect.

Can this be done and how? Thank you for suggestions all,

It would probably be better to do this without a navigation controller. You can create a custom container controller with a navigation bar at the top. You can add vc2 as a child of your container controller, remove the map view from vc1, add it to the view of vc2, and remove vc1 from the container controller. This would all be done with no animation, so the user shouldn't see anything happening in the main view. You can call pushNavigationItem:animated: on the navigation bar to animate in the new navigation item.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM