ios判断当前设备是否是ipad


+ (BOOL)getIsIpad

{

    NSString *deviceType = [UIDevice currentDevice].model;

    

    if([deviceType isEqualToString:@"iPhone"]) {

        //iPhone

        return NO;

    }

    else if([deviceType isEqualToString:@"iPod touch"]) {

        //iPod Touch

        return NO;

    }

    else if([deviceType isEqualToString:@"iPad"]) {

        //iPad

        return YES;

    }

    return NO;

}


// 如果判断当前ui布局,ipad也可能返回iphone布局,则用如下方法

 

    if ([[UIDevice currentDevice] userInterfaceIdiom] ==

        UIUserInterfaceIdiomPad)

        return YES;

    else{

        return NO;

    }
原文链接:https://blog.csdn.net/feifeiwuxian/java/article/details/58298462


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM