when viewController(A)
go to the next viewController(B)
, I change the title's color, and it worked, but when I go back to the parent viewController(A)
, I change the title's color through viewWillAppear
function, executed but didn't work, the color of title didn't change, How can I solve this problem? Thanks everyone.
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor redColor]}];
}
I find a solution: change title's color before go back to parent viewController(A)
in willMoveToParentViewController:(UIViewController *)parent;
function, Reference link,but the subclass viewController(B)
is third party library , I can't use this function so that can't detect does it will work or not. Is there any other solution?