Retina AdMob banner size for iphone screen

I set the size of my banner to 320 * 50. For the Retina display, I set it to 640 * 100. It does not display a banner at all. Could you tell me what mistake I made? It works when the size is 320 * 50, but not when it is 640 * 100.

+3
source share
2 answers

Use 320x50 on mesh devices. It is the responsibility of the ad network to return with a 2x density image so that it fits into your device, and not your responsibility to make the block twice as large.

+3
source

Yes, you use the same size on Retina devices.

However, you should not set a specific size at all. If you decide to convert your application to iPad, then your ad code will suddenly stop working, as it will stretch halfway across the screen.

Use the size of the smart banner, and Admob will work for you. For example, here is some code from one of my applications that puts a banner at the bottom of the screen. Pay attention, in particular, to the use of kGADAdSizeSmartBannerPortrait, this allows you to change the size of the advertising banner.

//Admob // Available AdSize constants are explained in GADAdSize.h. GADBannerView *bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait]; bannerView_.rootViewController = self; bannerView_.adUnitID = @"ca-app-pub-xxxxxxxxx/xxxx"; // Position the ad at the bottom of screen. // By default it would be postitioned at (0,0) bannerView_.frame = CGRectMake( 0, self.view.frame.size.height - bannerView_.frame.size.height, bannerView_.frame.size.width, bannerView_.frame.size.height ); bannerView_.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin; [self.view addSubview:bannerView_]; // Initiate a generic request to load it with an ad. GADRequest *request = [GADRequest request]; request.testDevices = [NSArray arrayWithObjects: GAD_SIMULATOR_ID, nil]; [bannerView_ loadRequest:request]; 
+5
source

All Articles