0

I have multi-image I add to bar item image but when I add it shows very big and I can't shrink them I don't know and I have costume back button but when I add it it shows far from the top left I use this code to add custom back but I add the bar item from storyboard if anyone can help.

this image of icon

let backImg: UIImage = UIImage(named: "back-btn")!
    let newBackButton = UIBarButtonItem(image: backImg, style: .plain, target: self, action: #selector(QuestionViewController.back(sender:)))
    self.navigationItem.leftBarButtonItem = newBackButton
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • Try to use PDF source image instead of using 1x , 2x , 3x . For ref:- https://stackoverflow.com/questions/35306051/using-pdfs-for-icon-images-in-xcode-7-2 – Jitendra Feb 05 '19 at 10:39

2 Answers2

3

Navigation Bar and Toolbar Icon Size

Use the following sizes for guidance when preparing custom navigation bar and toolbar icons, but adjust as needed to create balance.

enter image description here

AshokPolu
  • 645
  • 5
  • 12
0

For navigation set icons in image assets (Assets.xcassets) 1X = 28x28 pixel, 2X = 56x56 pixel and 3X = 84x84 pixel icon size.

https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/custom-icons/

AtulParmar
  • 4,358
  • 1
  • 24
  • 45