我正在实施iOS应用程序,在其中我想检查电池信息,如电池状态,当前电池水平,正在充电或没有插入,等等。我做了所有这些,但我想要更多关于电池的信息,如电池温度,电池健康,电池规模,电池技术。所有这些信息都可以在安卓系统中找到,但是有谁能帮我把所有这些信息都放在iOS中呢?
发布于 2012-11-12 19:14:53
尝尝这个
[[UIDevice currentDevice] setBatteryMonitoringEnabled:YES];
float batteryLevel = [[UIDevice currentDevice] batteryLevel];
//This will give you the battery between 0.0 (empty) and 1.0 (100% charged)
//If you want it as a percentage, you can do this:
batteryLevel *= 100;https://stackoverflow.com/questions/13342556
复制相似问题