更改“照片库”按钮的颜色

时间:2015-02-14 10:32:34

标签: ios swift alassetslibrary

我想改变它的颜色"取消"从照片库中选择图像时显示按钮和其他按钮。我怎样才能做到这一点?

var imagePicker = UIImagePickerController()
imagePicker.delegate = sender as? protocol<UIImagePickerControllerDelegate, UINavigationControllerDelegate>
imagePicker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary
imagePicker.allowsEditing = true
sender.navigationController?.presentViewController(imagePicker, animated: true, completion: nil)

enter image description here

1 个答案:

答案 0 :(得分:2)

目标 - C

AppDelegate.m

中添加以下代码
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];

夫特

AppDelegate.swift中,application(_:didFinishLaunchingWithOptions:)我提出以下内容:

UINavigationBar.appearance().tintColor = UIColor.whiteColor()

如果要更改导航栏的文本颜色,请使用以下代码:

UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName : UIColor.whiteColor()]