IOS广告

作者: mayday2024 | 来源:发表于2015-05-27 22:07 被阅读396次

    导入 iAd.framework
    #import "ViewController.h"
    #import <iAd/iAd.h>
    //遵守协议
    @interface ViewController ()<ADBannerViewDelegate>
    //广告的View
    @property (weak, nonatomic) IBOutlet ADBannerView *bannerView;
    //约束 加载完成改变
    @property (weak, nonatomic) IBOutlet NSLayoutConstraint *cons;

                @end
    
                @implementation ViewController
    
                - (void)viewDidLoad {
                    [super viewDidLoad];
                    
                    self.bannerView.delegate = self;
    
                }
                //加载完广告会调用
                - (void)bannerViewDidLoadAd:(ADBannerView *)banner
                {
                    self.cons.constant = 8;
                    
                    [UIView animateWithDuration:2.0 animations:^{
                    
                        [self.view layoutIfNeeded];
                    
                    }];
                    NSLog(@"加载完毕");
                }
    
                @end

    相关文章

      网友评论

        本文标题:IOS广告

        本文链接:https://www.haomeiwen.com/subject/uvmrqttx.html