隐藏系统状态栏 让app启动时图片全屏 进入程序后显示状态栏方法。
1.在<APP>-info.list文件中,加上“Status bar is initially hidden”选项,选择yes
2在程序里面添加 [[UIApplication sharedApplication]setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
即可
iOS 启动页广告
<span style="font-size:14px;">//
// LaunchScreenView.h
// ScreenRecordMaster
//
// Created by feimo on 15/9/10.
// Copyright (c) 2015年 feimo. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef void (^dismissBlock)();//声明回调Block
@interface LaunchScreenView : UIWindow
@property (strong,nonatomic) UIImageView *splashView;
@property (nonatomic, copy) dismissBlock dismissBlock;
- (void)dismiss:(dismissBlock)block;//设置回调Block
@end</span><strong style="font-size:24px;">
</strong>
//
// LaunchScreenView.m
// ScreenRecordMaster
//
// Created by feimo on 15/9/10.
// Copyright (c) 2015年 feimo. All rights reserved.
//
#import "LaunchScreenView.h"
@implementation LaunchScreenView
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
self.windowLevel = UIWindowLevelNormal;
self.windowLevel = UIWindowLevelStatusBar + 1.0f;
self.backgroundColor = [UIColor whiteColor];
[self addSplashView];
}
return self;
}
-(void)addSplashView
{
self.splashView = [[UIImageView alloc]initWithFrame:[[UIScreen mainScreen] bounds]];
[self.splashView setImage:[UIImage imageNamed:@"New_02.png"]];
[self addSubview:self.splashView];
[self performSelector:@selector(removeAdImageView) withObject:nil afterDelay:3];
}
- (void)removeAdImageView
{
[UIView animateWithDuration:0.2f animations:^{
//self.splashView.transform = CGAffineTransformMakeScale(0.3f, 0.3f);
self.splashView.alpha = 0.f;
self.alpha = 0.f;
} completion:^(BOOL finished) {
[self.splashView removeFromSuperview];
if (self.dismissBlock) {
self.dismissBlock();
}
}];
}
- (void)dismiss:(dismissBlock)block
{
self.dismissBlock = block;
}//设置回调Block
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
调用:
__block LaunchScreenView *launchView = [[LaunchScreenView alloc] initWithFrame:CGRectMake(0.0, 0.0, kDeviceWidth, kDeviceHeight)];
[launchView makeKeyAndVisible];
[launchView dismiss:^{
[launchView removeFromSuperview];
[launchView resignKeyWindow];
launchView=nil;//及时销毁
}];