简体   繁体   中英

Change UIBarButtonItem position

I'm trying to increase the navigation bar in my project with:

navigationBar?.frame.origin.y = +50

But it also change the left bar button item. Is there any way to move it back to the original position?

原始导航栏的图像

And then:

导航栏图片增加后

If you want to totally customized navigation bar then you should hide default navigation bar and you can use UIView work as NavigationBar . You can set desired height to it and you should keep it's width equal to your screen width . You should then add UIButton on that view at your desired position working as back button or other function!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM