Search code examples
iosuiwindow

How to get the top bar height of ios application window?


I need to layout a segment control right under the top bar height of a uiwindow such as this.

enter image description here

I have searched the UIWindow reference but found nothing.


Solution

  • That's known as the status bar. Off the top of my head I think you can find the frame for it using

    [UIApplication sharedApplication].statusbarFrame