ios - Using Autolayout, unable to move the navigation bar down 20px -


i have uitabbarcontroller has 4 tabs. 1 of tabs opens results screen (a uitableviewcontroller).

on showing screen, want move uinavigationbar down 20px (to make room custom uistatusbar show on screens).

on other screens, add code viewwillappear method change self.navigationcontroller.navigationbar.frame.origin.y 20.

but these "non-root" screens (i.e. pushed view button).

however on screen uinavigationbar must visible, though root view. use same code, doesn't move view down.

i'm assuming autolayout moving position, tried adding code viewwilllayoutsubviews , viewdidlayoutsubviews. when navigationbar doesn't move down until first time tableview scrolled.

what need force navigationbar move down (and stay down) before screen appears?

are using storyboards? set y in storyboards 20, make viewcontroller implement uinavigation bar, add code:

-(uibarposition)positionforbar:(id<uibarpositioning>)bar{         return uibarpositiontopattached;  } 

this tell app navigation bar attached, remain @ 20px extend background way up.. it'll it's @ y = 20.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -