Share via


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に設定すると、アプリケーションは、またはバッテリー状態変更通知 (BatteryStateDidChangeNotification) を読み取BatteryLevelBatteryStateることができません。

これは、バックグラウンド スレッドから使用できます。

適用対象