94-iPad和iPhone设置判断
2015-03-24 22:33
246 查看
iPad开发中比iPhone上多了两个控制器
1.UISplitViewConroller
2.UIPopoverController
这两个控件只能在iPad上运行
为了开发同时兼容 iPhone 和iPad 的应用,可以通过 iOS 提供的 UIDevice 类,该对象的 userInterfaceIdiom 属性返回一个UIUserInterfaceIdiom 枚举值, 该枚举值包含如下两个值
UIUserInterfaceIdiomPhone : 代表 iPhone 设备
UIUserInterfaceIdiomPad : 代表 iPad 设备
判断当前运行的设置代码如下
// 判断当前是不是运行在iPhone设备上
if ([[UIDevice currentDevice] userInterfaceIdiom]
== UIUserInterfaceIdiomPhone) {
…...
}
1.UISplitViewConroller
2.UIPopoverController
这两个控件只能在iPad上运行
为了开发同时兼容 iPhone 和iPad 的应用,可以通过 iOS 提供的 UIDevice 类,该对象的 userInterfaceIdiom 属性返回一个UIUserInterfaceIdiom 枚举值, 该枚举值包含如下两个值
UIUserInterfaceIdiomPhone : 代表 iPhone 设备
UIUserInterfaceIdiomPad : 代表 iPad 设备
判断当前运行的设置代码如下
// 判断当前是不是运行在iPhone设备上
if ([[UIDevice currentDevice] userInterfaceIdiom]
== UIUserInterfaceIdiomPhone) {
…...
}
// 适配时判断手机的系统版本 #define iOS7 ([UIDevice currentDevice].systemVersion.floatValue >= 7.0) | |
相关文章推荐
- 判断设备的类型ipad或者iphone,调用自带应用,禁止锁屏,设置icon上的数字
- iPad和iPhone的设置判断
- 浅谈iPhone和iPad开发中的图标设置
- 浅谈iPhone和iPad开发中的图标设置
- (iphone/ipad)一个简单的用代码判断当前设备的方法
- 判断设备是Iphone还是ipad
- 转载【判断 ipad,iphone,android,手机,电脑登录页面 】
- iPad和iPhone的app图标尺寸、用途、设置方法
- 判断Iphone,Ipad当前网络状态
- 谈iPhone和iPad开发中的图标设置
- 如何在程序中判断硬件的机型(是ipad还是iphone/ipod touch)
- 浅谈iPhone和iPad开发中的图标设置
- 如何判断 ios设备的类型(iphone,ipod,ipad)
- iPhone/iPad收发网易163/126邮箱邮件设置
- 企业邮箱如何在iphone、ipad、itouch等苹果手持设备中设置使用
- 在iPhone/iPad工程中设置常量
- JavaScript test() 方法及判断是否为iPhone|iPad|iPod
- 判断设备类型是iPhone还是iPad
- iphone和ipad设置束的运用!(Settings.bundle)