(1)首先是启动图片:http://www.360doc.com/content/16/0320/20/10408243_543891288.shtml
把上面的设置图片,下面的清空,如图
注意要把原来的app删除再安装,否则无效
(2)启动广告,这里用的是一个第三方库,github地址:https://github.com/CoderZhuXH/XHLaunchAd
使用的话在app delegate中导入头文件
#import <XHLaunchAd/XHLaunchAd.h>
在didFinishLaunchingWithOptions
[XHLaunchAd showWithAdFrame:CGRectMake(0, 0,self.window.bounds.size.width, self.window.bounds.size.height) setAdImage:^(XHLaunchAd *launchAd) {
//未检测到广告数据,启动页停留时间,默认3,(设置4即表示:启动页显示了4s,还未检测到广告数据,就自动进入window根控制器)
//launchAd.noDataDuration = 4;
//广告图片地址
NSString *imgUrl = @"http://c.hiphotos.baidu.com/image/pic/item/d62a6059252dd42a6a943c180b3b5bb5c8eab8e7.jpg";
//广告停留时间
NSInteger duration = 6;
//广告点击跳转链接
NSString *openUrl = @"http://www.baidu.com";
//2.设置广告数据
[launchAd setImageUrl:imgUrl duration:duration skipType:SkipTypeTimeText options:XHWebImageDefault completed:^(UIImage *image, NSURL *url) {
//异步加载图片完成回调,若需根据图片尺寸,刷新广告frame,可在这里操作
//launchAd.adFrame = ...;
} click:^{
//广告点击事件
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:openUrl]];
}];
} showFinish:^{
// //广告展示完成回调,设置window根控制器
self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[UIViewController alloc] init]];
}];