0

I just updated the files from admob and now with [bannerView_ addSubview:closeBtn]; I can't see the button anymore.. Someone can help me out ?

Alby
  • 273
  • 6
  • 14

2 Answers2

0

Here is the code for AdMob ,

in .h

#import "GADBannerView.h"  

and declare

GADBannerView *AdMob;

in .m

#define AdMob_ID @"yourAdMobId"

Then just call this method and provide your x and 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];
}
Rajneesh071
  • 30,846
  • 15
  • 61
  • 74
0

Could you try:

[bannerView_ bringSubviewToFront:closeBtn];
RajPara
  • 2,281
  • 1
  • 16
  • 9
  • I tried that, no results... Very weird. Anyways, I will add the button view in self.view instead. – Alby Dec 13 '12 at 23:37