ios - ios中的UIUserInterfaceIdiomPad
问题描述
ios中的UIUserInterfaceIdiomPad为什么要用?
在我的 mac book pro ipad 刺激器中
BOOL isIPad2 = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad &&
[UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]);
解决方案
UIUserInterfaceIdiomPad
用于了解当前设备是什么。来自苹果文档
对于通用应用程序,您可以使用此属性为特定类型的设备定制应用程序的行为。例如,iPhone 和 iPad 设备具有不同的屏幕尺寸,因此您可能希望根据当前设备的类型创建不同的视图和控件。
推荐阅读
- python - 从 3D 数组中获取 2D 索引?
- ios - iOS 字体名称列表
- javascript - 我在使用 if 语句时遇到问题
- node.js - 无法将nodejs微服务与spring boot应用程序(zuul服务器)连接起来
- javascript - 将 HTML、CSS 和 JS 转换为 React Native
- azure-active-directory - 有没有办法使用 PowerShell 更改 Azure Active Directory 应用程序的显示照片?
- python - ImportError:无法从“rasa_core.training”导入名称“在线”
- python - numpy数组的每个单元格是否可以从一个函数中迭代?
- saml - 使用 TCPdump 截断 SAMLResponse
- powershell - Powershell 制作 Dymo LabelWriter 450 标签