Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8687171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:03:10+00:00 2026-06-12T23:03:10+00:00

Can I display admob ads with a custom size in iphone, such as 280×50,

  • 0

Can I display admob ads with a custom size in iphone, such as 280×50, not 320×50 typically ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:03:11+00:00Added an answer on June 12, 2026 at 11:03 pm

    Custom Ad Size

    In addition to the standard AdMob ad units, DFP allows you to serve any sized ad unit into an application. Note that the ad size (width, height) defined for an ad request should match the dimensions of the ad view displayed on the application (i.e. DFPBannerView).

    Example:

    // Define custom GADAdSize of 280x30 for DFPBannerView
    GADAdSize customAdSize = GADAdSizeFromCGSize(280, 30);
    // Don't use autorelease if you are using ARC in your project
    self.adBanner = [[[DFPBannerView alloc] initWithAdSize:customAdSize] autorelease];
    

    Note: DFP does not currently support Smart Banners.

    Multiple Ad Sizes

    DFP allows you to specify multiple ad sizes which may be eligible to serve into a DFPBannerView. There are three steps needed in order to use this feature:

    In the DFP UI, create a line item targeting the same ad unit that is associated with different size creatives.
    In your application, set the validAdSizes property on DFPBannerView:

    // Define an optional array of GADAdSize to specify all valid sizes that are appropriate
    // for this slot. Never create your own GADAdSize directly. Use one of the
    // predefined standard ad sizes (such as kGADAdSizeBanner), or create one using
    // the GADAdSizeFromCGSize method.
    //
    // Note: Ensure that the allocated DFPBannerView is defined with an ad size. Also note
    // that all desired sizes should be included in the validAdSizes array.  
    
    GADAdSize size1 = GADAdSizeFromCGSize(CGSizeMake(120, 20));
    GADAdSize size2 = GADAdSizeFromCGSize(CGSizeMake(250, 250));
    GADAdSize size3 = GADAdSizeFromCGSize(CGSizeMake(320, 50));
    NSMutableArray *validSizes = [NSMutableArray array];
    [validSizes addObject:[NSValue valueWithBytes:&size1 objCType:@encode(GADAdSize)]];
    [validSizes addObject:[NSValue valueWithBytes:&size2 objCType:@encode(GADAdSize)]];
    [validSizes addObject:[NSValue valueWithBytes:&size3 objCType:@encode(GADAdSize)]];
    bannerView_.validAdSizes = validSizes;
    

    Implement the GADAdSizeDelegate method to detect an ad size change.

    @protocol GADAdSizeDelegate <NSObject>
    - (void)adView:(GADBannerView *)view willChangeAdSizeTo:(GADAdSize)size;
    @end
    

    Remember to set the delegate using the setAdSizeDelegate: before making the request for an ad.

    [bannerView_ setAdSizeDelegate:self];
    

    Be sure to set the GADBannerView’s adSizeDelegate property to nil before releasing the view:

    - (void)dealloc {
     bannerView_.adSizeDelegate = nil;
    
     // Don't release the bannerView_ if you are using ARC in your project
     [bannerView_ release];
     [super dealloc];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any firefox addon which can display my asp.net page viewstate size.... Any
I want to develop JSF page which can display the swap size if the
im looking for an ad framework that can display in-house ads in my finished
I am using AdMob to display ads in my Andorid app. It is a
We have an iPhone app that can display an image dataset and pass it
I can display a test ad using admob and sencha touch. But when test:false,
How I can display SharePoint controls (such as the PeoplePicker) in an ASP.NET Page
Possible Duplicate: Admob Error in Eclipse for android:configChanges I want to display AdMob's ads
Can the iPhone default system font display Japanese script? I have an iPhone which
I can display a simple Visual Basic inputbox from a PowerShell script like this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.