且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

确定是在 iPhone 还是 iPad 上运行的 API

更新时间:2023-02-22 12:03:58

Checkout UI_USER_INTERFACE_IDIOM.

Checkout UI_USER_INTERFACE_IDIOM.

返回当前设备支持的接口习惯用法.

Returns the interface idiom supported by the current device.

返回值
UIUserInterfaceIdiomPhone 如果设备是 iPhone 或 iPod touch 或 UIUserInterfaceIdiomPad 如果设备是 iPad.

Return Value
UIUserInterfaceIdiomPhone if the device is an iPhone or iPod touch or UIUserInterfaceIdiomPad if the device is an iPad.

UIUserInterfaceIdiom

应该在当前设备上使用的接口类型

The type of interface that should be used on the current device

typedef enum {
   UIUserInterfaceIdiomPhone,
   UIUserInterfaceIdiomPad,
} UIUserInterfaceIdiom;