[Android] BannerAd is right aligned on some devices
See original GitHub issuePlugin Version
0.13.0
Steps to Reproduce
I have implemented adWidget in the following format:
final Container adContainer = Container(
color: Colors.red,
constraints: BoxConstraints(
minHeight: myBanner.sizes.first.height.toDouble() + 10,
),
child: Column(
children: [
Flex(
direction: Axis.horizontal,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
color: Colors.green,
width: myBanner.sizes.first.width.toDouble(),
height: myBanner.sizes.first.height.toDouble(),
alignment: Alignment.center,
child: AdWidget(
ad: myBanner,
),
)
],
),
],
),
);
Expected results:
Ad should be centered and should cover the green rectangle.
Actual results:
Ad is aligned to the right of the screen.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16
Top Results From Across the Web
How to Fix All Items Right Aligned on Android
How to Fix All Items Right Aligned on Android · Now follow the way to fix – · Step-1: Tap on the Settings...
Read more >Banner ad guidance - Google AdMob Help
The examples will help to clarify some of the most frequently used banner ad placements and whether they are aligned with our policies...
Read more >Admob ads alignment issue in android - Stack Overflow
I have 5kV available to create a spark. Is limiting the current to 500uA as simple as putting a 10MOhm resistor in series?...
Read more >Banner Ads | Mobile Ads SDK for Android - Google Developers
Banner ads occupy a spot within an app's layout, either at the top or bottom of the device screen. They stay on screen...
Read more >Android AdMob Tutorial 2022 - 02 - Display a Simple Banner Ad
In this video, we learn about how to display a simple banner from AdMob in your android application.Integrate Google Mobile Ads SDK ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This appears to be happening when the size of the rendered ad does not match the AdSize that was requested.
For example, in https://github.com/googleads/googleads-mobile-flutter/issues/261#issuecomment-914229852 the size requested was
fullBanner
, but the image shows a 320x50 ad (most likely because 468 is too wide for the device). We make the ad container width 468, which looks nicer on iOS than Android, probably due to different default layout constraints.I think generally we need a better way to handle the case where the returned banner ad size does not match the requested size. Maybe something similar to
FluidAdWidget
or with different constraints.We’re looking into this issue.