John
John

Reputation: 1717

Misaligned Segmented Control for Nav Bar (ios)

Want to try to add a segmented control (centered) via the story board. Here's what I want it to look like and it works via the storyboard.

enter image description here

Here's what it turns out like on the emulator/phone.

enter image description here

Can someone tell me what I am doing wrong? The plus sign has some insets (4 on each side, but I don't think thats the main reason for alignment)

Here is the heiarchy?

enter image description here

Upvotes: 0

Views: 204

Answers (1)

Zahid
Zahid

Reputation: 562

You need to set titleView for navigationItem. Currently you are dealing it as a barButtonItem see how to set titleView.

enter image description here

enter image description here

Upvotes: 2

Related Questions