
2,在APPDelegate.m中增加属性:@property (strong, nonatomic) UIView *launchView
3,在- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions;中调用下面方法
-(void)setLaunchImg{
UIViewController *viewController = [[UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil] instantiateViewControllerWithIdentifier:@"LaunchScreen"]
self.launchView= viewController.view
self.launchView.frame = CGRectMake(0, 0, self.window.screen.bounds.size.width, self.window.screen.bounds.size.height)
[self.window addSubview:self.launchView]
UIImageView*imageV = [[UIImageViewalloc]initWithFrame:CGRectMake(0,0,self.launchView.frame.size.width,self.launchView.frame.size.height)]
[imageVsetImage:[UIImageimageNamed:@"logo.jpeg"]]
imageV.contentMode = UIViewContentModeScaleAspectFill
[self.launchViewaddSubview:imageV]
[self.window bringSubviewToFront:self.launchView]
//可以设置启动页的存在时间
[NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(removeLun) userInfo:nil repeats:NO]
}
-(void)removeLun
{
[self.launchView removeFromSuperview]
}
iOS APP启动画面必须是静态图片。但是你可以在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
里面载入你写着动画的view。在动画结束以后再进入程序。
只能通过这样的伪启动动画来做
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)