How to Position Banner Ads Over Uitabbar

How to position banner ads over UITabbar?

I solved the problem by positioning the ad with CGRectMake().

googleBannerView.frame = CGRectMake(0, (view.bounds.height - googleBannerView.frame.size.height) - 49, self.view.bounds.size.width, 49)

49 is the height of UITabBar.

Can the tab bar (using UITabBarController) go above iAds (or any banner ad)?

Changing the frame of a tabbar controller's view is really painful.

I once considered doing it for some reason and found Adam's answer to Subclass UITabBarController to adjust it's frame very helpful.

But keep in mind that UITabBarController is doing a lot of magic behind (like resizing itself and its view controllers' views at different times) and that it may change with future versions of the OS.

Changing the default behavior of Apple's UI components can also be ground to AppStore rejections (so far I've never seen iAd banners put below the tab bar.)

Positioning UITabBar at the top

Is it possible? Sure, but it violates the human interface guidelines.

Screenshots:

Portrait Landscape Storyboard

Code:

TabController.h:

#import <UIKit/UIKit.h>

@interface TabController : UITabBarController <UITabBarControllerDelegate>

@end

TabController.m:

#import "TabController.h"

@interface TabController ()

@end

@implementation TabController

- (void)viewDidLoad
{
[super viewDidLoad];

self.delegate = self;
}

- (void)viewWillLayoutSubviews
{
[super viewWillLayoutSubviews];

[self.tabBar invalidateIntrinsicContentSize];

CGFloat tabSize = 44.0;

UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;

if (UIInterfaceOrientationIsLandscape(orientation))
{
tabSize = 32.0;
}

CGRect tabFrame = self.tabBar.frame;

tabFrame.size.height = tabSize;

tabFrame.origin.y = self.view.frame.origin.y;

self.tabBar.frame = tabFrame;

// Set the translucent property to NO then back to YES to
// force the UITabBar to reblur, otherwise part of the
// new frame will be completely transparent if we rotate
// from a landscape orientation to a portrait orientation.

self.tabBar.translucent = NO;
self.tabBar.translucent = YES;
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}

@end

Display ADBannerView with UITableViewController inside UITabBarController

The best solution is to use view controller containment. Use a view controller subclass that will house both the ad view and the table view controller's view, and add the table view controller as a child of the container view controller. This should take care of content insets correctly. On each layout of the container controller's view, position the table controller view hierarchy correctly after positioning the ad view. If you wish to hide the ad view, simply hide or remove it from the container hierarchy, and extend the table controller's view hierarchy fully. When working with hierarchies, remember to always use the table controller's view and not the tableView directly.

My answer was adapted into the following GitHub repo:
https://github.com/JosephDuffy/iAdContainer

Placing UITabBar on top of the screen within UITabBarController

it is very possible to place the tab bar on top of the screen. here is a link to a github project that does place the tab bar on top of the screen. https://github.com/hollance/MHTabBarController

take a look at the project and let me know if you need any more help.

iOS UITabBar position and items

here is the steps :

  1. Add a Tab bar to your View controller .
  2. Drag a tab bar item and add it to you tab bar like soSample Image

And you are done; By default the tab bar will be added to the bottom of the screen

Admob allowed position

Google says in their guidelines for Discouraged banner implementations: [...] banner ads should not be placed immediately next to interactive elements and app content [...]. Leaving 1dp/1px space is not immediately next to anymore IMHO. I have banners at the bottom in every app and found many examples online how to add a banner close to (but not next to) interaction elements.

AdMob native ads for example are always quite close to interaction elements by design:

AdMob native ad



Related Topics



Leave a reply



Submit