简体   繁体   中英

compensating for the status bar at the top of the iPhone

I'm not sure what it's called. Status bar? With the reception and batter life on. But is there an easy way to tell if it's displaying in an app?

I'm writing some generic code and I want something to be positioned right at the top of the screen if there isn't a bar, and below the bar if there is. People should be able to just dump my code into their project and it should just work. Thanks.

This should work:

BOOL hidden = [UIApplication sharedApplication].isStatusBarHidden;

And yes, it's called status bar.

我相信,如果您将某帧的原点设置为(0,0),则会考虑到状态栏是否可见-视图将使用其自动调整大小蒙版调整/缩小。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM