开发者

iPhone pushViewController keep the right part of navigation bar

In an iPhone app I want to have a navigation button on the right side of the navigation bar of the root navigation controller. However this right button disappears every time I push another viewController on top of the navigation controller and the right slot becomes empty. How can I make sure it remains on its proper place. I am using Interface Builder.

The "View Controller Programming Guide for iOS", as I understand it, says that the new viewController I'm pushin开发者_StackOverflow中文版g has to have its navigationController property set to the current navigation controller, however this property is readonly. How can I achieve this?


This is the thing with Navigation controller

The left bar button is taken Automatically by the iOS for All viewControllers But you have to design the Rightbarbutton for the Specific ViewController

So for each ViewController in ViewDidLoad

UIBarButtonItem *rightCornerButton = [[UIBarButtonItem alloc] 
                                      initWithTitle:@"Client Profile" 
                                      style:UIBarButtonItemStylePlain target:self 
                                      action:@selector(onTouchRightBarButton:)];
[self.navigationItem setRightBarButtonItem:rightCornerButton];
[rightCornerButton release];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜