iPhone 在状态栏中添加图标(如电池指示器)
我想知道是否可以在 iPhone 状态栏上添加一个图标,就像电池和 WiFi 指示器一样。我该怎么做?
谢谢。
I was wondering if it is possible to add an icon to the iPhone status bar, much like the battery and wifi indicator. How can I do this?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
正如之前报道的,使用 SDK 无法做到这一点。
如果您在越狱环境中工作,则状态栏图标需要放置在 /System/Library/CoreServices/SpringBoard.app 中,有两个版本:Default_NAME.png 和 FSO_NAME.png。默认用于类似菜单栏的浅色状态栏、主屏幕上的 FSO 或使用黑色状态栏的应用程序。
SBStatusBarController 有一个名为 addStatusBarItem: 的方法,只需使用 @"NAME" 作为参数来调用它,它将为您处理其余的事情。
As previously reported, it's not possible to do so with the 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. Default is used in the light menubar-like status bar, FSO on the home screen or apps that use the black status bar.
SBStatusBarController has a method called addStatusBarItem:, just call it with @"NAME" as your argument and it will handle the rest for you.
由于甚至无法直接访问状态栏,我不这么认为。您只能通过 UIApplication 间接设置状态栏的一些属性,显示的图标不是其中之一。其他一切都是苹果的地盘。
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. Everything else is Apple's turf.
这是不可能的。
UIApplication
类为您提供了一些对外观的有限控制。您可能需要向 Apple Bug Reporter 提交增强请求。It is not possible to do this. The
UIApplication
class gives you some limited controls over appearance. You may want to file an enhancement request with Apple Bug Reporter.你不能在 SDK 中做到这一点,而且如果有人能够做到这一点,苹果会发出嘶嘶声。我知道有一种方法可以使用越狱工具来做到这一点,但我认为我不应该在这里讨论这些东西,因为还有其他网站讨论它
you can't do it in the sdk, plus apple would pitch a hissy fit if somebody was able to do it. 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