Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/98.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何更改UIImagePickerController导航栏字体?_Ios_Swift_Uinavigationcontroller_Uiimagepickercontroller - Fatal编程技术网

Ios 如何更改UIImagePickerController导航栏字体?

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.

我需要的是Helvetica Neue Light。下面是我如何创建控制器的

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按钮更改为带有左箭头的后退按钮,如果这是您所要求的。如果您正在使用导航控制器并将新的视图控制器推送到导航堆栈中,则会自动添加“后退”按钮。那么,如何更改“后退”按钮标题?如果您只想更改标题,请执行以下操作: