how can i add buttons to my navigation controller toolbar,so that i can see them in all views
I AM HA开发者_如何学GoVING nav controller and in main view.nib i added two buttons on to tool bar and i should view these in next views also,but iam not able to see right now those in next view , where i hav to add these so i can see these buttons or access in any view ....
any help appreciated...
Quick and easy way is to set the toolbar items for new view controller, before you push it.
// Assuming self.toolbarItems is already set.
UIViewController *newViewController = [[[UIViewController alloc] init] autorelease];
[newViewController setToolbarItems:self.toolbarItems];
[self.navigationController newViewController animated:YES];
If you're finding applying this method before each pushing tedious, then you can subclass all your UIViewController implementations, and have it's toolbar be set, once and for all. :)
You would need to set the toolbarItems property of each view.
When displayed, this toolbar obtains its current set of items from the toolbarItems property of the active view controller. When the active view controller changes, the navigation controller updates the toolbar items to match the new view controller, animating the new items into position when appropriate.
http://developer.apple.com/iphone/library/documentation/uikit/reference/UINavigationController_Class/Reference/Reference.html
精彩评论