iOS 日常开发随笔iOS Developer

判断当前设备是ipad还是iphone

2017-04-28  本文已影响25人  阿狸先森丶12138

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)

{

                    // 平板

}

其他的状态:

UIUserInterfaceIdiomPhone

UIUserInterfaceIdiomPad

UIUserInterfaceIdiomTV

UIUserInterfaceIdiomCarPlay

上一篇 下一篇

猜你喜欢

热点阅读