如何检查 iPhone 上是否显示主屏幕?
我希望能够从我的 MobileSubstrate dylib 调用应用程序上的 SBUIController's
activateApplicationAnimated:
。但是,如果 iPhone/iPod 处于锁定屏幕(或者应用程序已打开),则该呼叫将不起作用。如何测试主屏幕是否显示?
I want to be able to call SBUIController's
activateApplicationAnimated:
on an app from my MobileSubstrate dylib. However, that call won't work if the iPhone/iPod is at the lockscreen (or if an app is already open). How do I test to see if the homescreen is showing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您至少可以使用
-[SBAwayController isLocked]
(出现在 4.3 上,没有检查其他版本)来检查锁定状态。我在标题中找不到任何有趣的方法来检查主屏幕是否被应用程序遮挡。您可以尝试跟踪应用程序的启动和终止,但最好考虑使用 libactivator 来激活您的 Tweak。这将使用户能够配置触发它的内容,并且能够将操作限制为仅在主屏幕上。
请访问 iPhone 开发 Wiki 上的其页面查看!
You can check for the locked status, at least, using
-[SBAwayController isLocked]
(present on 4.3, no other versions checked). I can't find any interesting-looking methods in the headers for checking whether the homescreen is obscured by an application.You could attempt to track application launch and termination, but it might just be better to look into using libactivator for activating your Tweak. This will give the user the ability to configure what triggers it, AND the ability to restrict action to the homescreen only.
Check it out at its page on the iPhone Development Wiki!