iPhone: Move UINavigationBar down?

…衆ロ難τιáo~ 提交于 2019-12-02 04:26:58

Although late, I hope this can still help someone else out. I used Stephens code inside viewDidAppear:animated and the navigation bar stays put upon traveling back to the tab. This allowed me to use a logo above the navigation bar. I used this inside my viewController.

    - (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
self.navigationController.view.frame = CGRectMake(0.0, 100.0, 320.0, 426.0); 
self.navigationController.navigationBar.frame = CGRectMake(0.0, 0.0, 320.0, 44.0); 
[self loadData];
    }

I can change the frame by overriding the frame property in viewDidAppear of my custom navigation controller. I also add the navigation controller view to another view that is a subview of the window and make same clipping. Pay attention because in this way you're going to loose the standard calls to every view controllers that will be attached to the navigation controllers. I don't remember if I also used a custom view for my view controllers: maybe yes and with didMoveToSuperview or didMoveToWindow overrided just to emulate the default behaviour. Hope it helps and forgive my english.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!