判断用户的是iPhone还是iPad
2015-01-06 14:22
253 查看
在IOS3.2及以后的版本中, 可以使用UIKit中定义的函数UI_USER_INTERFACE_IDIOM来判断,
该函数返回两个值为UIUserInterfaceIdiomPhone和UIUserInterfaceIdiomPad.
为方便可在代码中定义isiPad来直接判断
code
UI_USER_INTERFACE_IDIOM
Returns the interface idiom supported by the current device.
code
Return Value
UIUserInterfaceIdiomPhone if the device is an iPhone or iPod touch or UIUserInterfaceIdiomPad if the device is an iPad.
Availability
Available in iOS 3.2 and later.
Declared In
UIDevice.
转载:http://www.xw.hb.cn/Html/Article/iPhone/iPhone-iPad-check.html
该函数返回两个值为UIUserInterfaceIdiomPhone和UIUserInterfaceIdiomPad.
为方便可在代码中定义isiPad来直接判断
Returns the interface idiom supported by the current device.
UIUserInterfaceIdiomPhone if the device is an iPhone or iPod touch or UIUserInterfaceIdiomPad if the device is an iPad.
Availability
Available in iOS 3.2 and later.
Declared In
UIDevice.
转载:http://www.xw.hb.cn/Html/Article/iPhone/iPhone-iPad-check.html
相关文章推荐
- 判断用户当前设备是iphone还是ipad
- iPhone开发 判断用户使用的是ipad还是iphone
- 判断用户设备是iPad还是iPhone的代码
- 判断用户设备是iPad还是iPhone的代码
- 判断用户设备是iPad还是iPhone的代码
- 判断用户设备是iPad还是iPhone的代码
- 判断用户设备是iPad还是iPhone的代码
- js判断是否是ipad还是iphone及各手机用户
- 判断设备类型是iPhone还是iPad
- 如何判断是iphone还是ipad
- iOS之cell和lable自适应大小和判断是ipad还是iphone
- 基于jQuery的判断iPad、iPhone、Android是横屏还是竖屏的代码
- 判断设备是iphone还是ipad
- 根据用户使用的是iphone还是ipad来设置显示内容的大小
- 基于jquery判断ipad、iphone和Android横屏还是竖屏
- ios判断设备是iphone还是ipad
- 判断设备是iPhone还是iPad
- ios判断设备是iphone还是ipad
- 基于jQuery的判断iPad、iPhone、Android是横屏还是竖屏的代码
- 如何判断是iphone还是ipad