More than 1 rightBarButtonItem on navigation bar

前端 未结 9 977
清歌不尽
清歌不尽 2021-01-30 02:06

I would like to have two rightBarButtonItems on navigation bar. One for Edit and the other for Add.

Obviously I can\'t make it using Interface Builder.

Does anyb

9条回答
  •  北恋
    北恋 (楼主)
    2021-01-30 02:34

    the navigation bar is a UIView so you can simply create a regulat UIButton and add it to your navigation bar as a subView.

    Set the frame relative to the nav bar. If you want it to look exactly like the built in button, you will probably have to produce the graphics yourself as they are not exposed to the SDK AFAIK.

提交回复
热议问题