开发者

Navigation bar items disappear from navigation bar

开发者 https://www.devze.com 2023-03-02 11:06 出处:网络
I have been struggling for some time with the strange behavior of navigation bar items. I have segmented control o开发者_开发百科n the navigation bar (take a look at the image below)

I have been struggling for some time with the strange behavior of navigation bar items. I have segmented control o开发者_开发百科n the navigation bar (take a look at the image below)

Navigation bar items disappear from navigation bar

where List button pushes table view controller with UISearchDisplayController. To show table view controller I use the code as it follows:

if (uiSegmentedControl.selectedSegmentIndex == 1 )
{
    DetailsTableVewController* detailsViewController = [[DetailsTableVewController alloc] 
                                                         initWithList:list]; 
    [self.navigationController pushViewController:detailsViewController animated:YES];
    [detailsViewController release];
}    

Then to return back I use the following code:

[self.navigationController popViewControllerAnimated:YES];

Although I use the code above to go back to the previous controller when UISearchDisplayController is either active or inactive I have different behavior of the navigation bar items. When UISearchDisplayController is active ALL items disappear from the navigation bar

Navigation bar items disappear from navigation bar

Does anybody know why it happens? Thanks in advance.


Moved all navbar initialization code from viewDidLoad to viewWillAppear in controller and it solved the problem

0

精彩评论

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