iOS获取电量方法
时间:2014-10-10 16:30:25
收藏:0
阅读:320
ios简单的方法:
[UIDevice currentDevice].batteryMonitoringEnabled = YES;
double
deviceLevel = [UIDevice currentDevice].batteryLevel;
获取当前剩余电量, 我们通常采用上述方法。这也是苹果官方文档提供的。
它返回的是0.00-1.00之间的浮点值。 另外, -1.00表示模拟器。
原文:http://www.cnblogs.com/zhujin/p/4015868.html
评论(0)