美文网首页
iOS判断是什么device

iOS判断是什么device

作者: 童冀 | 来源:发表于2016-03-16 16:17 被阅读354次

    [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad;

    typedef NS_ENUM(NSInteger, UIUserInterfaceIdiom) {
    UIUserInterfaceIdiomUnspecified = -1,
    UIUserInterfaceIdiomPhone NS_ENUM_AVAILABLE_IOS(3_2), // iPhone and iPod touch style UI
    UIUserInterfaceIdiomPad NS_ENUM_AVAILABLE_IOS(3_2), // iPad style UI
    UIUserInterfaceIdiomTV NS_ENUM_AVAILABLE_IOS(9_0), // Apple TV style UI
    UIUserInterfaceIdiomCarPlay NS_ENUM_AVAILABLE_IOS(9_0), // CarPlay style UI
    };

    相关文章

      网友评论

          本文标题:iOS判断是什么device

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