YPImagePicker icon indicating copy to clipboard operation
YPImagePicker copied to clipboard

Cancel button always black colored

Open StackHelp opened this issue 4 years ago • 5 comments

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):

  • Device: iPhone 7
  • OS: 10.15.4
  • Xcode Version: 11.4.1
  • Swift Version: 5.1

Installation Type

  • Cocoapods

StackHelp avatar Jul 07 '20 13:07 StackHelp

This is a working example:

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

heitara avatar Aug 04 '20 23:08 heitara

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

UINavigationBar.appearance().tintColor

not working

tallot13 avatar Aug 21 '20 08:08 tallot13

This is a working example:

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

worked, but not in album...

tallot13 avatar Aug 21 '20 08:08 tallot13

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

tallot13 avatar Aug 21 '20 09:08 tallot13

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

micabal avatar Jan 15 '22 08:01 micabal