iOS开发之状态栏UIStatusBar图标操作

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了iOS开发之状态栏UIStatusBar图标操作相关的知识,希望对你有一定的参考价值。

NSArray *subIcons = [[[[UIApplication sharedApplication] valueForKeyPath:@"statusBar"] valueForKeyPath:@"foregroundView"] subviews];
技术分享
Printing description of subIcons:
<__NSArrayM 0x7ff61141b640>(
<UIStatusBarServiceItemView: 0x7ff61171ad10; frame = (6 0; 39 20); autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x7ff611712480>> [Item = <UIStatusBarItem: 0x7ff61170fa90> [UIStatusBarServiceItemView (Left)]],
<UIStatusBarDataNetworkItemView: 0x7ff61141b010; frame = (50 0; 13 20); autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x7ff611419c60>> [Item = <UIStatusBarItem: 0x7ff611419670> [UIStatusBarDataNetworkItemView (Left)]],
<UIStatusBarBatteryItemView: 0x7ff61141bad0; frame = (384 0; 25 20); autoresize = LM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x7ff61141a720>> [Item = <UIStatusBarItem: 0x7ff61141a880> [UIStatusBarBatteryItemView (Right)]],
<UIStatusBarTimeItemView: 0x7ff6114212c0; frame = (185 0; 49 20); userInteractionEnabled = NO; layer = <CALayer: 0x7ff6114216c0>> [Item = <UIStatusBarItem: 0x7ff611702c90> [UIStatusBarTimeItemView (Center)]]
)
技术分享
 for (id icon in subIcons) {
       /......
}

以上是关于iOS开发之状态栏UIStatusBar图标操作的主要内容,如果未能解决你的问题,请参考以下文章

ios上 更改 状态栏(UIStatusBar)的颜色,你值得一看收藏

UIStatusBar iOS上状态栏的自定义颜色

如何在 iOS 应用程序中完全删除 UIStatusBar?

iOS开发 获取状态栏的点击事件

iOS杂货

在 iOS 中自定义 UIStatusBar