美文网首页iOS 日常开发随笔iOS Developer
判断当前设备是ipad还是iphone

判断当前设备是ipad还是iphone

作者: 阿狸先森丶12138 | 来源:发表于2017-04-28 16:07 被阅读25次

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

{

                    // 平板

}

其他的状态:

UIUserInterfaceIdiomPhone

UIUserInterfaceIdiomPad

UIUserInterfaceIdiomTV

UIUserInterfaceIdiomCarPlay

相关文章

网友评论

    本文标题:判断当前设备是ipad还是iphone

    本文链接:https://www.haomeiwen.com/subject/joqazttx.html