Yummypets / YPImagePicker

📸 Instagram-like image picker & filters for iOS
MIT License
4.32k stars 976 forks source link

Cancel button always black colored #522

Open StackHelp opened 4 years ago

StackHelp commented 4 years ago

I have tried to set the tint color of the navigation bar as suggested in ReadMe but still the cancel button always of black color. How to make it of a different colors?

   let attrs = [
        NSAttributedString.Key.foregroundColor: UIColor.white,
        NSAttributedString.Key.font: UIFont.boldFont()
    ]

    UINavigationBar.appearance().barTintColor = UIColor(hexInt: 0x00113A)
    UINavigationBar.appearance().titleTextAttributes = attrs
    UINavigationBar.appearance().tintColor = UIColor.white.withAlphaComponent(0.7)

    UIBarButtonItem.appearance().setTitleTextAttributes([NSAttributedString.Key.font: UIFont.boldFont()], for: .normal)

Also, can we change picker background color i.e. white currently?

Environment (please complete the following information):

Installation Type

heitara commented 4 years ago

This is a working example:


        let picker = YPImagePicker(configuration: config)
        picker.navigationBar.tintColor = .red
tallot13 commented 4 years ago

also black in sample project in this repo, left bar button items not changed color

UINavigationBar.appearance().tintColor

not working

tallot13 commented 4 years ago

This is a working example:

        let picker = YPImagePicker(configuration: config)
        picker.navigationBar.tintColor = .red

worked, but not in album...

tallot13 commented 4 years ago

https://github.com/Yummypets/YPImagePicker/blob/5f90725766db9d6a9437b82ee63658042eaf67d1/Source/YPPickerVC.swift#L200 https://github.com/Yummypets/YPImagePicker/blob/5f90725766db9d6a9437b82ee63658042eaf67d1/Source/YPImagePicker.swift#L56 how avoid this? color hardcoded. After removed this lines, UINavigationBar.appearance().tintColor - works Simulator Screen Shot - iPhone SE (2nd generation) - 2020-08-21 at 12 20 59

micabal commented 2 years ago

Update to the latest version 5.2.1 I had the same issue with the outdated 4.5.0 😉