문제

My application flow: AViewController -> BViewController -> CViewController (via navigationController). AViewController and CViewController looks the same, only BViewController looks different.

I did it this way:

/// AppDelegate (should be 'super' settings)
[[UINavigationBar appearanceWhenContainedIn:[ABCNavigationController class], nil] setBackgroundImage:theImage forBarMetrics:UIBarMetricsDefault];

/// BViewController (should apply ONLY to BViewController)
[self.navigationController.navigationBar setBackgroundImage:BImage forBarMetrics:UIBarMetricsDefault];

The problem is that in CViewController i see the image i loaded in BViewController not in appDelegate. How to restore it to appDelegate settings?

I should underline that backgroundImage is one of many elements that i setup, gave it here as example.

도움이 되었습니까?

해결책

In CViewController try setting the navbar's background image to nil in viewWillAppear, cause it reamains set by your BViewController.

[self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top