Skip to content
FengYan枫炎 edited this page Jun 30, 2025 · 1 revision

Device

提供了对用户设备状态等信息的访问。

方法

Version GetIOSVersion()

获取系统版本

  • 返回值:系统版本,获取失败返回 Version(0, 0)

bool TryGetIOSVersion(out Version iOSVersion)

获取系统版本

  • 参数:iOSVersion — out 输出 Version 对象,失败则为 null
  • 返回值:系统版本,获取失败返回 Version(0, 0)

bool IsIPhoneNotchScreen()

是否是 iPhone 刘海屏

UIDeviceOrientation GetDeviceOrientation()

获取当前设备的物理朝向

bool IsRunningOnMac()

判断当前 app 是否运行在 Mac 环境下

bool IsRunningOnIpad()

判断当前 app 是否运行在 iPad 环境下

string GetLocaleISOCode()

获取当前设备的ISO地区码(ISO 3166-1 alpha-2)

string GetLanguageISOCode()

获取用户系统设置的主要语言的IETF标签(例:zh-Hans-CN)

格式:[language]-[Script]-[REGION]_[sort order]

  • 返回值:语言IETF标签

Clone this wiki locally