Change color of navigation bar of the MPMediaPickerController, possible?
I have a MPMediaPickerController that lets the user pick his/her own songs in my app. Problem is my app has the "开发者_JAVA百科black" navigation bar throughout and the picker is the standard blue. Now I know it's not allowed/possible to subclass the picker but is there any other way to change the navigation bar to "black"?
I ended up doing a 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 will however change all navbars.
精彩评论