我需要更改 MPMediaPickerController 中图标的灰色,当它们未被选中时,背景是不透明的,就像褪色一样,我也需要删除它。
我正在使用 ios7.1 和下一个代码在我的 viewController 上显示 MPMediaPickerController 元素。
- (IBAction)addSongs:(id)sender {
MPMediaPickerController *picker = [[MPMediaPickerController alloc]
initWithMediaTypes:MPMediaTypeMusic];
picker.delegate = self;
picker.allowsPickingMultipleItems = YES;
[self presentViewController:picker animated:YES completion:nil];
}
AppDelegate 上的这段代码
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[UIView appearance] setTintColor:[UIColor whiteColor]];
return YES;
}
例子:
最佳答案
这与 MPMediaPickerController customize the colors of the labels and icons 相同
.... 在应用委托(delegate)中:
[[UIView appearance] setTintColor:[UIColor blueColor]];
该命令为标签栏、工具栏等所有带有 sillohouette 图标的东西设置色调....你的标签栏似乎在黑暗的窗口背景下是半透明的....我也在我的应用程序中使用 mpmediapickercontroller 和自从移至 IOS 7 后,我的默认设置为全白背景。我相信这是你的 windows.backgroundcolor 我的设置为白色。
关于ios - 未选中时图标的 MPMediaPickerController 背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22134898/