statusbar - Get iPhone Status Bar Height -


i need resize elements in relation height of iphone's status bar. know status bar 20 points high isn't case when it's in tethering mode. gets doubled 40. proper way determine determine it's height? i've tried

[[uiapplication sharedapplication] statusbarframe] 

but gives me 20 x 480 in landscape correct gives me 320 x 40 in portrait. why isn't giving me opposite of (40 x 320)?

the statusbarframe returns frame in screen coordinates. believe correct way corresponds in view coordinates following:

- (cgrect)statusbarframeviewrect:(uiview*)view  {     cgrect statusbarframe = [[uiapplication sharedapplication] statusbarframe];      cgrect statusbarwindowrect = [view.window convertrect:statusbarframe fromwindow: nil];      cgrect statusbarviewrect = [view convertrect:statusbarwindowrect fromview: nil];      return statusbarviewrect; } 

now in cases window uses same coordinates screen, [uiwindow convertrect:fromwindow:] doesn't change anything, in case might different method should right thing.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -