我想在MPMediaPickerController视图上对颜色进行一些更改。
MPMediaPickerController *mediaPicker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic];
mediaPicker.delegate = self;
mediaPicker.allowsPickingMultipleItems = YES; // this is the default
[self presentViewController:mediaPicker animated:YES completion:nil];
[mediaPicker release];
请帮助
答案 0 :(得分:1)
您可以更改MPMediaPickerController的barStyle我认为您无法自定义所有MPMediaPickerController可能(可能)媒体选择器在您尝试设置工具栏样式的时间点没有导航工具栏。您是否检查过mediaPicker.navigationController是否有值?
我建议将媒体选择器控制器嵌入到您自己的视图层次结构中(MPMediaPickerController的文档说它是可能的),然后您可以从您自己的视图控制器完全控制导航栏。
// create media picker controller
mediaPicker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic];
// set properties
mediaPicker.delegate = self;
mediaPicker.prompt = @"Choose your song:";
// get the media picker's view and set its frame
UIView *pickerView = mediaPicker.view;
pickerView.frame = myViewController.view.frame;
// add the media picker view to the view hierarchy
[myViewController.view addSubview:pickerView];
您需要浏览Apple Doc