Customize UIStatusBar in iOS

2020-06-27 01:35发布

问题:

Is there a way to customize the UIStatusBar class?

回答1:

For an example what you can do with (or around) the status bar, look at this Github project: https://github.com/myell0w/MTStatusBarOverlay

I have used it in a project of mine, and it goes through app review just fine.



回答2:

You can not customize the UIStatusBar. What you can do, is to put another UIView on top (with any customizations you want).

For example, something like:

MyView * myview = [[MyView alloc] initWithFrame:[[UIApplication sharedApplication] statusBarFrame]];
[[[UIApplication sharedApplication] keyWindow] addSubview:myview];