Bannières de taille fixe
Le SDK Google Mobile Ads est compatible avec les tailles d'annonces fixes lorsque les bannières adaptatives ne répondent pas à vos besoins.
Le tableau suivant répertorie les tailles de bannière standards.
Taille en dp (LxH) |
Description |
Disponibilité |
Constante AdSize |
320 x 50 |
Bannière |
Téléphones et tablettes |
GADAdSizeBanner |
320 x 100 |
Grande bannière |
Téléphones et tablettes |
GADAdSizeLargeBanner |
300 x 250 |
Rectangle moyen IAB |
Téléphones et tablettes |
GADAdSizeMediumRectangle |
468 x 60 |
Bannière IAB en taille réelle |
Tablettes |
GADAdSizeFullBanner |
728 x 90 |
Classement IAB |
Tablettes |
GADAdSizeLeaderboard |
Pour définir une taille de bannière personnalisée, définissez-la à l'aide de GADAdSizeFromCGSize
:
Swift
let adSize = GADAdSizeFromCGSize(CGSize(width: 250, height: 250))
Objective-C
GADAdSize size = GADAdSizeFromCGSize(CGSizeMake(250, 250));
Exemple d'annonces bannières à taille fixe
Swift
Objective-C
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/02/20 (UTC).
[null,null,["Dernière mise à jour le 2025/02/20 (UTC)."],[[["The Google Mobile Ads SDK offers fixed ad sizes as an alternative to adaptive banners."],["Standard banner sizes include Banner (320x50), Large Banner (320x100), IAB medium rectangle (300x250), IAB full-size banner (468x60), and IAB leaderboard (728x90), each with specified availability for phones and/or tablets."],["Custom banner sizes can be defined using `GADAdSizeFromCGSize` by providing the desired width and height."],["Code examples for implementing fixed size banner ads are available in both Swift and Objective-C."]]],["The Google Mobile Ads SDK supports fixed-size banner ads with standard sizes for phones and tablets. Available sizes include 320x50 (Banner), 320x100 (Large banner), 300x250 (IAB medium rectangle), 468x60 (IAB full-size banner), and 728x90 (IAB leaderboard), each with a corresponding `GADAdSize` constant. Custom sizes can be set using `GADAdSizeFromCGSize`, demonstrated in Swift and Objective-C examples provided in the documentation.\n"]]