From be9aaa58ba286b3262435d8e3076d93d150706cf Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 6 Dec 2022 10:17:13 +0100 Subject: [PATCH] [ios] Settings and routing options table headers are visible now in the Dark Mode Signed-off-by: Siarhei Fedartsou --- .../Components/MWMTableViewController.m | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/iphone/Maps/Classes/Components/MWMTableViewController.m b/iphone/Maps/Classes/Components/MWMTableViewController.m index e53286a0f0..6e77cc0019 100644 --- a/iphone/Maps/Classes/Components/MWMTableViewController.m +++ b/iphone/Maps/Classes/Components/MWMTableViewController.m @@ -19,6 +19,23 @@ return NO; } +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + + for (NSInteger i = 0; i < [self numberOfSectionsInTableView:self.tableView]; i++) { + [self updateHeaderView:[self.tableView headerViewForSection:i]]; + } +} + +// Fix table section header font color for all tables, including Setting and Route Options. +- (void)updateHeaderView:(UIView*)headerView { + if ([headerView isKindOfClass: [UITableViewHeaderFooterView class]]) { + UITableViewHeaderFooterView* header = (UITableViewHeaderFooterView *)headerView; + header.textLabel.textColor = [UIColor blackSecondaryText]; + } +} + - (void)viewDidLoad { [super viewDidLoad]; @@ -31,6 +48,10 @@ forCellReuseIdentifier:[MWMTableViewSubtitleCell className]]; } +- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section { + [self updateHeaderView:view]; +} + #pragma mark - Properties - (BOOL)hasNavigationBar