Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何制作一个计算电池状态的iphone应用程序?是否有我需要使用的特定 API?
谁有任何在线教程的链接?
刚设置[UIDevice currentDevice].batteryMonitoringEnabled = YES。然后你可以使用-[UIDevice batteryState]and -[UIDevice batteryLevel]。
[UIDevice currentDevice].batteryMonitoringEnabled = YES
-[UIDevice batteryState]
-[UIDevice batteryLevel]