0

我想对 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];

请帮忙

4

1 回答 1

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

于 2013-07-31T11:10:55.050 回答