Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要知道当前设备是 iPad2 还是新 iPad。我使用[[UIScreen mainScreen] Scale],但结果是 1.0
[[UIScreen mainScreen] Scale]
如发现here:
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad && [[UIScreen mainScreen] respondsToSelector:@selector(scale)] && [UIScreen mainScreen].scale > 1) { // new iPad }