if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
CGFloat scale = [[UIScreen mainScreen] scale];
if (scale > 1.0)
{
//iPad retina screen
}
else
{
//iPad screen
}
}
else
{
if ([UIScreen instancesRespondToSelector:@selector(scale)])
{
CGFloat scale = [[UIScreen mainScreen] scale];
if (scale > 1.0)
{
if([[ UIScreen mainScreen ] bounds ].size.height == 568)
{
//iphone 5
}
else
{
//iphone retina screen
}
}
else
{
//iphone screen
}
}
}
如何判断iphone4、iphone4s、iphone5、iPad、iPad retina
最新推荐文章于 2024-08-28 15:00:20 发布