Wednesday, June 26, 2024
HomeiOS Developmentios - Is it doable to alter navigation bar background colour for...

ios – Is it doable to alter navigation bar background colour for a particular view controller in UINavigationController?


Thanks @matt’s reply. The UINavigationBarAppearance can do this type of work change bar look for particular controller

However at first , my code will not be working after doing because the official information:
enter image description here

Appears this information is a few form of deceptive .
you possibly can’t set the customized look to the navigation controller itself . it’s important to set it to the navigaitonItem

and it really works now:

UINavigationBarAppearance* seem = [UINavigationBarAppearance new];
[appear setBackgroundColor:[UIColor redColor]];

//    self.navigationController.navigationBar.scrollEdgeAppearance = seem;
//    self.navigationController.navigationBar.compactAppearance = seem;
//    self.navigationController.navigationBar.standardAppearance = seem;
//    self.navigationController.navigationBar.compactScrollEdgeAppearance = seem;
    self.navigationItem.scrollEdgeAppearance = seem;
    self.navigationItem.compactAppearance = seem;
    self.navigationItem.standardAppearance = seem;



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments