Skip to content

android: banner ad cropped when margin is large #375

@zipperdev

Description

@zipperdev

Describe the bug
On Android, banner ad is cropped when the margin is bigger than (SCREEN_HEIGHT / 2) - BANNER_AD_HEIGHT, which is exceeding the center of the screen. This problem occurs at all sizes and all positions. (except BannerAdPosition.CENTER, because it does not apply any margin) On iOS, the ad is not cropped and the margin is applied properly.

To Reproduce
Steps to reproduce the behavior:

  1. Show any size of banner ad
  2. Set the ad margin to be bigger than (SCREEN_HEIGHT / 2) - BANNER_AD_HEIGHT
  3. Ad is cropped on Android

Expected behavior
Banner ad should be moved properly without any cropping.

Screenshots

Normal behavior (iOS)

Normal behavior (iOS) 👍

Bad behavior (Android)

Bad behavior (Android) 😭

when more margin is applied!
Worse behavior (Android) 😭😭😭

Smartphone (please complete the following information):

  • Device: Samsung S24
  • OS: Android 15 (One UI 7.0)
  • Browser: Android System WebView 140.0.7339.51
  • Version: SDK 35

Additional context (Reproduction code)

AdMob.showBanner({
    adId: "ca-app-pub-xxxxxx",
    adSize: BannerAdSize.MEDIUM_RECTANGLE, // any size
    position: BannerAdPosition.BOTTOM_CENTER, // any position
    margin: 250, // quite big margin
    isTesting: true,
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions