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];
}