0

我刚刚从 admob 更新了文件,现在使用 [bannerView_ addSubview:closeBtn]; 我再也看不到按钮了..有人可以帮我吗?

4

2 回答 2

0

你能试试:

[bannerView_ bringSubviewToFront:closeBtn];
于 2012-12-11T18:15:07.393 回答
0

这是代码AdMob

.h

#import "GADBannerView.h"  

并声明

GADBannerView *AdMob;

.m

#define AdMob_ID @"yourAdMobId"

然后只需调用此方法并提供您的 x 和 y

-(void)adMobCode
{

    AdMob = [[GADBannerView alloc]
             initWithFrame:CGRectMake(0.0,410,
                                      GAD_SIZE_320x50 .width,
                                      GAD_SIZE_320x50.height)];

    AdMob.adUnitID = AdMob_ID;
    AdMob.rootViewController = self;
    [self.view addSubview:AdMob];


    UIButton *Yourbtn = [[UIButton alloc]initWithFrame:CGRectMake(0, AdMob.frame.origin.y, 30, 30)];
    Yourbtn.tag=2;
    [Yourbtn addTarget:self action:@selector(YourbtnPress:) forControlEvents:UIControlEventTouchDown];
    UIImage *PlayBtnImage = [UIImage imageNamed:@"play.png"];
    [Yourbtn setImage:PlayBtnImage forState:UIControlStateNormal];
    [self.view addSubview:Yourbtn];


    GADRequest *r = [[GADRequest alloc] init];
    r.testing = YES;
    [AdMob loadRequest:r];
}
于 2012-12-09T10:37:03.653 回答