Dealing with iPad Mini screen size

前端 未结 9 2199
栀梦
栀梦 2020-11-29 00:06

The new iPad Mini has a 7.9 inch screen size. Does it have a retina display? Will it automatically scale existing xibs and storyboards or do we have to create two versions o

9条回答
  •  半阙折子戏
    2020-11-29 00:46

    I think Phil Schiller (Apple's Senior Vice President) said it best in press event unveiling the iPad Mini (approximately 53:00 into the keynote)

    What screen size do we pick and why? And the team worked really hard thinking about this. We want an iPad that is capable of running all that amazing software written for iPad without the developers having to do any work...

    He then goes on to say:

    ...And the pixels are even easier to remember because they're exactly the same. The original iPad and the iPad 2 are 1024 by 768 and the new iPad Mini is 1024 by 768. That means all of the software created for iPad works on the iPad Mini unchanged.

    So, in summary and to answer your question, no the iPad Mini does not have a Retina display, and you don't have to do any additional work. The iPad Mini will utilize the storyboard or xib you have already created for iPads.

    Then as far as detection goes, I can't find anything to prove this yet (because they haven't been released yet) but I'd be willing to bet that the following will output "iPad Mini".

    NSLog(@"%@",[[UIDevice currentDevice] model]);
    

    EDIT:

    NSLog(@"\nMachine ID: %@\nModel: %@\nLocalized Model: %@",machineName(),[[UIDevice currentDevice] model],[[UIDevice currentDevice] localizedModel]);
    
    NSString *machineName()
    {
    
        struct utsname systemInfo;
        uname(&systemInfo);
    
        return [NSString stringWithCString:systemInfo.machine
                                  encoding:NSUTF8StringEncoding];
    }
    

    On my 16GB iPad Mini (Wifi only) this returns:

    Machine ID: iPad2,5
    Model: iPad
    Localized Model: iPad

提交回复
热议问题