Ios 如何更改UIImagePickerController导航栏字体?
我需要的是Helvetica Neue Light。下面是我如何创建控制器的Ios 如何更改UIImagePickerController导航栏字体?,ios,swift,uinavigationcontroller,uiimagepickercontroller,Ios,Swift,Uinavigationcontroller,Uiimagepickercontroller,我需要的是Helvetica Neue Light。下面是我如何创建控制器的 let picker: UIImagePickerController = UIImagePickerController() picker.delegate = self picker.allowsEditing = false picker.navigationBar.tintColor = UIColor.whiteColor() picker.sourceType = .PhotoLibrary picker.
let picker: UIImagePickerController = UIImagePickerController()
picker.delegate = self
picker.allowsEditing = false
picker.navigationBar.tintColor = UIColor.whiteColor()
picker.sourceType = .PhotoLibrary
picker.navigationController?.navigationBar.tintColor = UIColor.blueColor()
self.presentViewController(picker, animated: true, completion: { _ in })
这就是你如何做到的:
picker.navigationBar.titleTextAttributes =
[NSForegroundColorAttributeName: UIColor.redColor(),
NSFontAttributeName: UIFont.init(name: "Helvetica", size: 21)!]
另外,您的代码有一个小问题:
UIImagePickerController
源自UINavigationController
,并且picker.navigationController?
在上面的代码中总是nil
您是否尝试设置了picker.navigationBar.titleTextAttributes?您知道如何通过我的代码访问“库后退”按钮吗?我需要将其更改为“后退”按钮arrow@ConnorB,据我所知,没有明确的方法将bar按钮更改为带有左箭头的后退按钮,如果这是您所要求的。如果您正在使用导航控制器并将新的视图控制器推送到导航堆栈中,则会自动添加“后退”按钮。那么,如何更改“后退”按钮标题?如果您只想更改标题,请执行以下操作: