UIDocumentPickerViewController - How to set the navigation bar color

前端 未结 1 1597
傲寒
傲寒 2021-02-08 02:16

I want to set the navigation bar background color of my DocumentPicker to be the same as the rest of my application.

           


        
1条回答
  •  醉酒成梦
    2021-02-08 02:26

    This will change the color of the text like "Cancel".

    UIBarButtonItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName:UIColor.blue], for: .normal)
    

    and this will change the arrow back color.

    UIButton.appearance().tintColor = UIColor.blue
    

    Don't forget to set it back to your original colors after closing the picker if it required.

    0 讨论(0)
提交回复
热议问题