Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make my iAd banner appear at bottom of screen?

I have the following code that allows me to position it on the top. I am wanting it to appear at the bottom.

 adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
 adView.frame = CGRectOffset(adView.frame, 0, -50);
 adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierPortrait];
 adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
 [self.view addSubview:adView];

Any assistance will be appreciated.

like image 478
jini Avatar asked Nov 03 '11 03:11

jini


People also ask

Why is there a bar at the bottom of my IPAD screen?

All replies It's always at the bottom of the screen. jkershner4, The line shows where you can swipe up on your screen to access the Home screen. If you see it when an app is open it means that you can swipe up to exit the app.

How do I get icons at bottom of iPhone screen?

If you already have four items in your Dock, drag and drop one of the app icons from the Dock to the Home screen. Next, drag the app icon you want to move into the Dock from the Home screen and position it wherever you want it on the Dock. Repeat this with any other app icons you wish to move.

How do I put my apps on the bottom of my screen?

Change an app At the bottom of your screen, you'll find a row of favorite apps. Remove a favorite app: From your favorites, touch and hold the app that you'd like to remove. Drag it to another part of the screen. Add a favorite app: From the bottom of your screen, swipe up.


1 Answers

Update—@larsacus pointed out this is for 4.2+:

adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierPortrait];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
CGRect adFrame = adView.frame;
adFrame.origin.y = self.view.frame.size.height-adView.frame.size.height;
adView.frame = adFrame;
[self.view addSubview:adView];

Shown working in simulator

like image 101
james_womack Avatar answered Nov 15 '22 05:11

james_womack