1

i am developing a application which have a activity indicator in UINavigationbar and the problem is that when i hide the activity indicator the default navigation back button not displayed in ios 7 but in ios 6 it works perfectly

i am getting self.navigationItem.backBarButtonItem as nil when i print it in console

after hiding activity indicator i have written below code

[self.navigationItem setLeftBarButtonItem:self.navigationItem.backBarButtonItem];

Thanks in advance

4

2 回答 2

1

代替:

[self.navigationItem setLeftBarButtonItem:self.navigationItem.backBarButtonItem];

尝试使用:

[self.navigationItem setBackBarButtonItem:self.navigationItem.backBarButtonItem];

(我不确定这是否会完全像这样工作。您可能必须在显示活动指示器之前将后退按钮存储在一个变量中,然后再将后退按钮设置为该变量。)

于 2013-10-29T09:01:53.547 回答
0

我是一名初学者,但我的理解是显示的后退按钮实际上是前一个视图控制器的属性,而不是显示的视图控制器的属性。

除非您为当前可见的视图控制器手动设置了后退按钮,否则它应该为零。

尝试从堆栈中的前一个视图控制器记录后退按钮项,这可能会有所帮助

于 2013-11-05T08:53:52.643 回答