ios怎么跳过launch screen

发布网友 发布时间:2022-04-20 12:08

我来回答

1个回答

热心网友 时间:2023-08-04 07:54

#import "AppDelegate.h"
#import "UIImageView+WebCache.h"
@interface AppDelegate ()
@property (strong, nonatomic) UIView *lunchView;
@end

@implementation AppDelegate
@synthesize lunchView;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

[self.window makeKeyAndVisible];

lunchView = [[NSBundle mainBundle ]loadNibNamed:@"LaunchScreen" owner:nil options:nil][0];
lunchView.frame = CGRectMake(0, 0, self.window.screen.bounds.size.width, self.window.screen.bounds.size.height);
[self.window addSubview:lunchView];

UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 50, 320, 300)];
NSString *str = @"";
[imageV sd_setImageWithURL:[NSURL URLWithString:str] placeholderImage:[UIImage imageNamed:@"default1.jpg"]];
[lunchView addSubview:imageV];

[self.window bringSubviewToFront:lunchView];

[NSTimer scheledTimerWithTimeInterval:3 target:self selector:@selector(removeLun) userInfo:nil repeats:NO];

return YES;
}

-(void)removeLun
{
[lunchView removeFromSuperview];
}

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com