iOS开发小点之启动广告界面

来源:互联网 发布:mac可以玩守望先锋吗 编辑:程序博客网 时间:2024/05/18 04:25
1.若是想让程序延迟几秒,完全展示程序启动界面可以这样做
- (BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions{     //延迟3秒     [NSThread sleepForTimeInterval:3];}

2.很多APP启动的时候,需要动态的更换启动页面

ADView 设为全局变量

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    [self.window makeKeyAndVisible];        ADView = [[NSBundle mainBundle ]loadNibNamed:@"LaunchScreen" owner:nil options:nil][0];    ADView.frame = CGRectMake(0, 0, self.window.screen.bounds.size.width, self.window.screen.bounds.size.height);        [self.window addSubview:ADView];        UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)];        NSString *str = @"http://pic.nipic.com/2008-04-01/20084113367207_2.jpg";        [imageV sd_setImageWithURL:[NSURL URLWithString:str] placeholderImage:[UIImage imageNamed:@"new_feature_1"]];        [ADView addSubview:imageV];        [self.window bringSubviewToFront:ADView];        [NSTimer scheduledTimerWithTimeInterval:15 target:self selector:@selector(removeADView) userInfo:nil repeats:NO];        return YES;}#pragma mark - 移除广告View-(void)removeADView {        [ADView removeFromSuperview];    }


0 0
原创粉丝点击