Friday, 15 February 2013

ios - Navigationbar not repositioning after adding statusbar -



ios - Navigationbar not repositioning after adding statusbar -

i have navigationbar-positioning problem seems have appeared ios6. acts in many ways similar proplem users experiencing when rotating views

the app has splash screen, displayed total screen (achieved setting hide statusbar during application launch true)

then in viewdidload in master view controller next line adds statusbar app:

[[uiapplication sharedapplication] setstatusbarhidden:no withanimation:uistatusbaranimationnone];

this adds statusbar app, , shifts view downwards 20pt expected. however, navigationbar stays put, underneath statusbar 20pt glitch underneath.

before ios6 used prepare adding next line of code:

[uiapplication sharedapplication].keywindow.frame=cgrectmake(0, 20, 320, [[uiscreen mainscreen] bounds].size.height-20);

now, however, not work.

some research shows @ time of calling viewdidload, keywindow.frame has size , origin both of {0,0}, , altering has no effect.

when inserting 2 lines mentioned above viewdidappear same behaviour when app launches. when dhen move view , first view however, alteration of keywindow.frame has desired effect , navigationbar ends positioned should be.

my question then: how create navigationbar gets it's right position after adding statusbar ios-app when statusbar hidden?

call setstatusbarhidden:no on viewwillappear instead.

ios ios6 uinavigationbar statusbar

No comments:

Post a Comment