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) {
       /......
}

 

转载于:https://www.cnblogs.com/starainDou/p/5781349.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值