UI
ImagePickerController的导航栏的正确方法是什么?
我只是试图看到背景颜色,但我正在得到一个褪色的颜色,如下图所示;好像有些看法阻碍了它.
let picker = UIImagePickerController() picker.sourceType = type picker.mediaTypes = [kUTTypeImage] picker.delegate = self picker.navigationBar.backgroundColor = UIColor.redColor()
它似乎有一些视图模糊了redColor():
(lldb) po picker.navigationBar.subviews 2 values { [0] = 0x00007fe7bb52a890 [1] = 0x00007fe7bb52b670 }
为导航栏创建纯色的正确方法是什么?
为了完整,我将添加全彩定制设置:
原文链接:https://www.f2er.com/swift/319691.htmllet imagePicker = UIImagePickerController() imagePicker.navigationBar.translucent = false imagePicker.navigationBar.barTintColor = .blueColor() // Background color imagePicker.navigationBar.tintColor = .whiteColor() // Cancel button ~ any UITabBarButton items imagePicker.navigationBar.titleTextAttributes = [ NSForegroundColorAttributeName : UIColor.whiteColor() ] // Title color
这导致: