iPhone: Move UINavigationBar down?

后端 未结 2 916
感动是毒
感动是毒 2021-01-22 19:36

I\'m trying to position the navigation bar below the top of the screen.

I\'ve tried the following in viewWillAppear:

self.navigationControll         


        
相关标签:
2条回答
  • 2021-01-22 20:24

    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];
        }
    
    0 讨论(0)
  • 2021-01-22 20:24

    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.

    0 讨论(0)
提交回复
热议问题