Note that there are some explanatory texts on larger screens.

plurals
  1. POTab Bar Item Images Invisible in MoreNavigationController with Black Background
    primarykey
    data
    text
    <p>I have a Tab Bar (UITabBarController) application with a "More" View Controller because of having more than 5 views. The rest of my application has a black background and white text, and I have been able to customize this table to match this. As a result of this however, the Tab Bar images that normally appear on the left side of the "More" table are invisible (since they're meant for a white background). I need to find a way to make the Tab Bar images display as they do in the Tab Bar which itself has a black background.</p> <p>Example: </p> <p><a href="https://imgur.com/oQM9N.png" rel="nofollow noreferrer">Black Background (Invisible Images)</a></p> <p>I have subclassed the TabBarController and changed the data source for the "MoreTableView":</p> <p><strong>TabBarController.m</strong></p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; UINavigationController *moreController = self.moreNavigationController; moreController.navigationBar.barStyle = UIBarStyleBlackOpaque; if ([moreController.topViewController.view isKindOfClass:[UITableView class]]) { UITableView *view = (UITableView *)moreController.topViewController.view; view.separatorColor = [[UIColor alloc] initWithRed:0.3 green:0.3 blue:0.3 alpha:1.0]; view.backgroundColor = [UIColor blackColor]; view.dataSource = [[MoreTableViewDataSource alloc] initWithDataSource:view.dataSource]; } } </code></pre> <p><strong>MoreTableViewDataSource.m</strong></p> <pre><code>-(MoreTableViewDataSource *) initWithDataSource:(id&lt;UITableViewDataSource&gt;) dataSource { originalDataSource = dataSource; [super init]; return self; } - (NSInteger)tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section { return [originalDataSource tableView:table numberOfRowsInSection:section]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [originalDataSource tableView:tableView cellForRowAtIndexPath:indexPath]; cell.textColor = [[UIColor alloc] initWithRed:1 green:0.55 blue:0 alpha:1.0]; cell.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"customAccessory.png"]]; return cell; } </code></pre> <p>Thanks in advance,<br> Julian</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload