开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜