0

I am using a PDF image for a UINavigationBarButtonItem, but the text from the image is not displaying on the button, and I do not know why. Do I need to use and SVG image format?

let liveIcon = UIImage(named: "LiveIcon")?.scaleTo(CGSize(width: 30, height: 20))
        liveStreamButtonItem = UIBarButtonItem(image: liveIcon, style: .plain, target: self, action: #selector(self.liveStreamTapped))
        liveStreamButtonItem.tintColor = .systemRed
        liveStreamButtonItem.isEnabled = false
        
        navigationItem.rightBarButtonItems = [searchBarButtonItem, liveStreamButtonItem]

Button appearance Image

Noah Iarrobino
  • 1,435
  • 1
  • 10
  • 31
  • 1
    Try making `LIVE` cut a hole in the red circle (for transparency) instead of overlaying it as white text. – aheze Dec 01 '21 at 17:55
  • Can this layout work on a `UIButton`? If so, then try creating that first then use `UIBarButtonItem(customView:)`. –  Dec 02 '21 at 01:03

0 Answers0