简体   繁体   English

iPhone在状态栏中添加图标(电池指示灯)

[英]iPhone add icon in status bar (a la Battery Indicator)

I was wondering if it is possible to add an icon to the iPhone status bar, much like the battery and wifi indicator. 我想知道是否可以在iPhone状态栏中添加一个图标,就像电池和wifi指示器一样。 How can I do this? 我怎样才能做到这一点?

Thanks. 谢谢。

As previously reported, it's not possible to do so with the SDK. 如前所述,使用SDK无法实现。

If you're working for a jailbroken environment, status bar icons need to be placed within /System/Library/CoreServices/SpringBoard.app with two versions: Default_NAME.png and FSO_NAME.png. 如果您正在为越狱环境工作,则需要将状态栏图标放在/System/Library/CoreServices/SpringBoard.app中,其中包含两个版本:Default_NAME.png和FSO_NAME.png。 Default is used in the light menubar-like status bar, FSO on the home screen or apps that use the black status bar. 默认用于轻型菜单栏状态栏,主屏幕上的FSO或使用黑色状态栏的应用程序。

SBStatusBarController has a method called addStatusBarItem:, just call it with @"NAME" as your argument and it will handle the rest for you. SBStatusBarController有一个名为addStatusBarItem:的方法,只需用@“NAME”作为参数调用它,它将为你处理其余的事。

Since it is not even possible to access the status bar directly, I wouldn't think so. 由于甚至无法直接访问状态栏,我不这么认为。 You can only indirectly set a few of the status bar's properties through UIApplication, the displayed icons are not one of them. 您只能通过UIApplication间接设置一些状态栏的属性,显示的图标不是其中之一。 Everything else is Apple's turf. 其他一切都是苹果公司的地盘。

It is not possible to do this. 这是不可能的。 The UIApplication class gives you some limited controls over appearance. UIApplication类为您提供了一些有限的外观控制。 You may want to file an enhancement request with Apple Bug Reporter . 您可能希望使用Apple Bug Reporter提交增强请求。

you can't do it in the sdk, plus apple would pitch a hissy fit if somebody was able to do it. 你不能在sdk中做到这一点,如果有人能够做到这一点,那么苹果就会表现得很合适。 I know there's a way to do it with the jailbroken tools, but I don't think I should discuss that stuff here as there are other sites that discuss it 我知道有一种方法可以使用越狱工具来实现,但我认为我不应该在这里讨论这些内容,因为还有其他网站在讨论它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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