UIDevice.BatteryMonitoringEnabled 属性

定义

控制电池监视。 设置后,可以接收电池电量更改事件。

[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.TvOS, ObjCRuntime.PlatformArchitecture.All, null)]
public virtual bool BatteryMonitoringEnabled { [Foundation.Export("isBatteryMonitoringEnabled")] [ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.TvOS, ObjCRuntime.PlatformArchitecture.All, null)] get; [Foundation.Export("setBatteryMonitoringEnabled:")] [ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.TvOS, ObjCRuntime.PlatformArchitecture.All, null)] set; }
member this.BatteryMonitoringEnabled : bool with get, set

属性值

默认值为 false

属性

注解

设置为 默认值 false时,应用程序无法读取 BatteryLevelBatteryState或 接收电池状态更改通知 (BatteryStateDidChangeNotification) 。

这可以从后台线程使用。

适用于