0

Integrated the Rev Mob banner type Ad with my iOS app.It was successfully displayed the Ads of banner type. But I want to change the banner position to top of the screen.How can I change the position of banner type Ad to top? For displaying the banner type Ad I used the following code,

 [[RevMobAds session] showBanner];
Dan Hanly
  • 7,829
  • 13
  • 73
  • 134
Arunkumar
  • 55
  • 1
  • 8
  • possible duplicate of [How to initiate revmob banner ad with exact frame and placement ID?](http://stackoverflow.com/questions/13068356/how-to-initiate-revmob-banner-ad-with-exact-frame-and-placement-id) – Dan Hanly Oct 11 '13 at 07:56

2 Answers2

3

You can always use a UIView to put the banner into. In banner load delegate, resize your intermediate view to banner's bounds.

In your ViewDidLoad Declare :-

ad = [[[RevMobAds session] bannerView] retain];
ad.delegate = self;
[ad loadAd];

Then add a method

- (void)revmobAdDidReceive {
  intermediateView.frame = CGRectMake(0,0, somewidth, someheight);
  ad.frame = intermediateView.bounds;
  [intermediateView addSubview:ad];
}

Or simply set the frame accordingly.

RevMobBannerView *ad = [[RevMobAds session] bannerView];
ad.delegate = self;
[ad loadAd];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
  ad.frame = CGRectMake(0, 0, 768, 114);
} else {
  ad.frame = CGRectMake(0, 0, 320, 50);
}

[self.view addSubView:ad];
IronManGill
  • 7,222
  • 2
  • 31
  • 52
0

From their documentation (and it works well for me) :

RevMobBannerView *banner = [[RevMobAds session] bannerView];
banner.delegate = self;

[banner loadWithSuccessHandler:^(RevMobBannerView *banner) {
   [banner setFrame:CGRectMake(10, 20, 200, 40)];
   [self.view addSubview:banner];
   NSLog(@"Ad loaded");
 } andLoadFailHandler:^(RevMobBannerView *banner, NSError *error) {
   NSLog(@"Ad error: %@",error);
 } onClickHandler:^(RevMobBannerView *banner) {
   NSLog(@"Ad clicked");
 }];
Macistador
  • 854
  • 12
  • 23