如何获取 UIDevice BatteryLevel 以 1% 或更精细的增量提供状态
UIDevice BatteryLevel 返回的“默认”数据似乎以 5% 为增量。我怎样才能将其达到 1% 或更精细?
It seems the "default" data returned by UIDevice batteryLevel is in 5% increments. How do I get it to 1% or finer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
UIKit 调用检索电池只能获得 0.0 到 1.0 之间的更好数字,步长为 0.05,这意味着 5% 的间隔。为了获得更精细的粒度,您可能必须越狱设备并设置类似 此,但您可能无法提交应用程序。以防万一,我发现了这篇帖子,您可能会感兴趣。
The UIKit calls to retrieve Battery can only get a number better 0.0 to 1.0 with 0.05 steps which means 5% intervals. In order to get it with finer granularity you might have to jail break the device and setup something like this but you might not be able to submit the app. Just in case, I came across this post, which might be of interest to you.
如果你想为越狱设备进行开发,你可以看看这个示例
if you wanna develop for jailbroken devices, you can take a look at this example