Is it possible to change the color of the MPMediaPickerController navigation bar?

I have an MPMediaPickerController that allows the user to select their own songs in my application. The problem is that my application has a black navigation bar, and the collector has a standard blue one. Now I know that this is not allowed / it is possible to subclass the collector, but is there any other way to change the navigation bar to black?

+3
source share
1 answer

I took up the category.

@implementation UINavigationBar (CustomImage)
- (void)drawRect:(CGRect)rect {
    UIImage *image = [UIImage imageNamed:@"CustomNavBar.png"];
    [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];

    self.barStyle = UIBarStyleBlack;
}

This, however, will change all navigators.

-1
source

Source: https://habr.com/ru/post/1760289/


All Articles