UIDevice.BatteryLevel Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Battery level indicator.
[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.TvOS, ObjCRuntime.PlatformArchitecture.All, null)]
public virtual float BatteryLevel { [Foundation.Export("batteryLevel")] [ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.TvOS, ObjCRuntime.PlatformArchitecture.All, null)] get; }
member this.BatteryLevel : single
Property Value
Battery percentage in the range [0..1] if battery monitoring is enabled, otherwise -1.
- Attributes
Remarks
By default, BatteryMonitoringEnabled is false
. In that situation, BatteryLevel will be -1 (and BatteryState will be Unknown).
A value of 1.0 indicates a fully-charged device, while 0.0 indicates an empty battery.
This can be used from a background thread.