I hope I'm not duplicating any threads now but I can't find a good answer to my question. I have more than five tabs so a more-tab automatically turns up. I've managed to change some of it's setting, such as title, background and style of the navigationbar and so on. My problem is that I can't figure out how to change the text color in the more table view. The rest of the app has black background in all table views, with white text.
With the code-line: tabBarController.moreNavigationController.topViewController.view.backgroundColor = [UIColor blackColor];
I get a black background. Any ideas on how to change the text color?
Try this:
UITableView *view = (UITableView*)self.tabBarController.moreNavigationController.topViewController.view;
if ([[view subviews] count]) {
for (UITableViewCell *cell in [view visibleCells]) {
cell.textLabel.textColor = [UIColor redColor];
}
}
Swift 4 version:
if let tableView = moreNavigationController.topViewController?.view as? UITableView {
for cell in tableView.visibleCells {
cell.textLabel?.textColor = .red
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With