欢迎光临
我们一直在努力

启动动画广告支持gif动画,网络图片,本地图片

建站超值云服务器,限时71元/月

启动动画广告支持gif动画,网络图片,本地图片

项目介绍:

LBLaunchImageAd

效果图如下:

(LBLaunchImageAd)

本框架依赖SDWebImage

导入LBLaunchImageAd

AppDelegate.mdidFinishLaunchingWithOptions方法中复制如下代码即可

如果需要网络请求得到URL的例子如下

    //初始化一个adView
    LBLaunchImageAdView * adView = [[LBLaunchImageAdView alloc]init];
    //举个例子[LBNetWork PostAPI:url Dic:nil Suc:^(NSDictionary *Res)是自己封装的网络请求    
    [LBNetWork PostAPI:url Dic:nil Suc:^(NSDictionary *Res) {

        NSArray *arr = Res[@"resultContent"];
        NSString *imgURL = nil;
        for (NSDictionary *dic in arr) {
            imgURL = [NSString stringWithFormat:@"xxxxx%@",dic[@"imgpath"]] ;
        }
        //关键地方
        if (imgURL) {
            adView.getLBlaunchImageAdViewType(LogoAdType);
            adView.imgUrl = imgURL;
            //各种回调
            adView.clickBlock = ^(NSInteger tag){
                switch (tag) {
                    case 1100:{
                        
                    }
                        break;
                    case 1101:
                        NSLog(@"点击跳过回调");
                        self.window.rootViewController = _tabBarController;
                        break;
                    case 1102:
                        NSLog(@"倒计时完成后的回调");
                        self.window.rootViewController = _tabBarController;
                        break;
                    default:
                        break;
                }
                
            };
        }

    } Fai:^(NSURLSessionDataTask *operation) {
        
    }];

如果直接是固定的图片Url

    LBLaunchImageAdView * adView = [[LBLaunchImageAdView alloc]init];
    adView.getLBlaunchImageAdViewType(LogoAdType);
    adView.imgUrl = @"http://www.uisheji.com/wp-content/uploads/2013/04/19/app-design-uisheji-ui-icon20121_55.jpg";
    adView.clickBlock = ^(NSInteger tag){
        switch (tag) {
            case 1100:{
                
            }
                break;
            case 1101:
                NSLog(@"点击跳过回调");
                self.window.rootViewController = _tabBarController;
                break;
            case 1102:
                NSLog(@"倒计时完成后的回调");
                self.window.rootViewController = _tabBarController;
                break;
            default:
                break;
        }
                    
    };

如果是本地图片


LBLaunchImageAdView * adView = [[LBLaunchImageAdView alloc]init];
adView.getLBlaunchImageAdViewType(LogoAdType);
adView.localAdImgName = @"qidong.png"; 
//各种回调
adView.clickBlock = ^(NSInteger tag){
    switch (tag) {
        case 1100:{
            NSLog(@"点击广告回调");
            TestViewController *vc = [[TestViewController alloc]init];
            vc.view.backgroundColor = [UIColor whiteColor];
            [self.window.rootViewController presentViewController:vc animated:YES completion:^{
                
            }];
        }
            break;
        case 1101:
            NSLog(@"点击跳过回调");
            break;
        case 1102:
            NSLog(@"倒计时完成后的回调");
            break;
        default:
            break;
    }
    
};

github地址:
https://github.com/AllLuckly/LBLaunchImageAd
code4app

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 启动动画广告支持gif动画,网络图片,本地图片
分享到: 更多 (0)