How to add custom view on right of navigation bar Swift?

前端 未结 6 1576
猫巷女王i
猫巷女王i 2020-12-16 21:59

I am trying to add a custom view on right of UINavigationBar. What I tried is the following, but the view is not showing up! Pleas

6条回答
  •  忘掉有多难
    2020-12-16 22:13

    I assume your rigthtBarButtonItem is nil. Instead init a new UIBarButtonItem with your custom view and set this as the rightBarButtonItem. Give it a try

提交回复
热议问题