Adding constraints to a UIBarButtonItem

后端 未结 2 988
孤独总比滥情好
孤独总比滥情好 2020-12-20 22:17

Xcode is not allowing me to put constraints on my BarButtonItem on a ViewController in the MainStoryBoard. It\'s appearing too far to the left where it\'s unrea

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-20 22:55

    Drag and drop navigation bar in your xib / story board

    U can add constraints to this navigation bar as per your requirement.

    Then add Bar Button Item to your navigation bar

    Bar Button Item takes it default position u cannot incorporate autolayout there.

    Although if u want positions of Bar Button Item Fixed or Flexible u can make use of Fixed Space Bar Button Item or Flexible Space Bar Button Item.

    If positions are fixed drag Fixed Space Bar Button between your two Bar Button Item's. And if positions is not fixed its flexible drag Flexible Space Bar Button Item between your two Bar Button Item's.

    Happy Coding.. :)

提交回复
热议问题