时间:2021-05-20
本代码支持 iPhone 6 以下. 支持 iPhone 及 iPad
+(NSString*)getLaunchImageName{NSArray* images= @[@"LaunchImage.png", @"LaunchImage@2x.png",@"LaunchImage-700@2x.png",@"LaunchImage-568h@2x.png",@"LaunchImage-700-568h@2x.png",@"LaunchImage-700-Portrait@2x~ipad.png",@"LaunchImage-Portrait@2x~ipad.png",@"LaunchImage-700-Portrait~ipad.png",@"LaunchImage-Portrait~ipad.png",@"LaunchImage-Landscape@2x~ipad.png",@"LaunchImage-700-Landscape@2x~ipad.png",@"LaunchImage-Landscape~ipad.png",@"LaunchImage-700-Landscape~ipad.png"];UIImage *splashImage;if ([self isDeviceiPhone]){if ([self isDeviceiPhone4] && [self isDeviceRetina]){splashImage = [UIImage imageNamed:images[1]];if (splashImage.size.width!=0)return images[1];elsereturn images[2];}else if ([self isDeviceiPhone5]){splashImage = [UIImage imageNamed:images[1]];if (splashImage.size.width!=0)return images[3];elsereturn images[4];}elsereturn images[0]; //Non-retina iPhone}else if ([[UIDevice currentDevice] orientation]==UIDeviceOrientationPortrait || [[UIDevice currentDevice] orientation] == UIDeviceOrientationPortraitUpsideDown)//iPad Portrait{if ([self isDeviceRetina]){splashImage = [UIImage imageNamed:images[5]];if (splashImage.size.width!=0)return images[5];elsereturn images[6];}else{splashImage = [UIImage imageNamed:images[7]];if (splashImage.size.width!=0)return images[7];elsereturn images[8];}}else{if ([self isDeviceRetina]){splashImage = [UIImage imageNamed:images[9]];if (splashImage.size.width!=0)return images[9];elsereturn images[10];}else{splashImage = [UIImage imageNamed:images[11]];if (splashImage.size.width!=0)return images[11];elsereturn images[12];}}}+(BOOL)isDeviceiPhone{if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){return TRUE;}return FALSE;}+(BOOL)isDeviceiPhone4{if ([[UIScreen mainScreen] bounds].size.height==480)return TRUE;return FALSE;}+(BOOL)isDeviceRetina{if ([[UIScreen mainScreen] respondsToSelector:@selector(displayLinkWithTarget:selector:)] &&([UIScreen mainScreen].scale == 2.0)) // Retina display{return TRUE;}else // non-Retina display{return FALSE;}}+(BOOL)isDeviceiPhone5{if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone && [[UIScreen mainScreen] bounds].size.height>480){return TRUE;}return FALSE;}声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
本文实例讲述了Android简单实现启动画面的方法。分享给大家供大家参考,具体如下:核心代码:packagecom.demo.app;importandroid
本文实例讲述了Android启动画面的实现方法。分享给大家供大家参考。具体分析如下:在应用程序中经常用到启动画面,会启动一个后台线程为主程序的运行准备资源。An
本文实例讲述了c#制作简单启动画面的方法。分享给大家供大家参考。具体分析如下:启动画面是程序启动加载组件时一个让用户稍微耐心等待的提示框。一个好的软件在有启动等
本文实例讲述了Android开发之背景动画简单实现方法。分享给大家供大家参考,具体如下:1、先创建动画层,有三张图片2、使用:Viewviewanim=view
本文实例讲述了Android开发之使用ExifInterface获取拍照后的图片属性。分享给大家供大家参考,具体如下:ExifInterfaceexif=new