0

Basically I want to achieve this using UIBarButton:

enter image description here

I tried using setTitle but I end up having something like this:

enter image description here

JVS
  • 2,362
  • 3
  • 18
  • 28

2 Answers2

0

Create your custom navigation bar - add UIView to top of your viewcontroller, and add UIButton in left corner of it. And label underneath button.

Anton Novoselov
  • 719
  • 2
  • 8
  • 19
0

Can be done by using custom view with UIBarButtonItem. Something like this.

Swift

let image = UIImage.init(named: "image_name")
let button = UIButton.init(type: .custom)
button.frame = CGRect.init(x: 0, y: 0, width: 100, height: 40)
button.setBackgroundImage(image, for: .normal)
button.setTitle("title", for: .normal)
let barButtonItem = UIBarButtonItem.init(customView: button)
Bilal
  • 17,228
  • 8
  • 53
  • 69