I have a Google AdMob Banner that I want to display on a custom position. The line below works just fine in my...
...
bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom);
...
Though when I want to place the banner at a custom position it never displays on the screen. I am doing:
...
int w = 0;
int h = Screen.height/2;
bannerView = new BannerView(adUnitId, AdSize.Banner, w, -h);
...
What am I doing wrong?
Docs for AdMob Banner ad can be found here: https://developers.google.com/admob/unity/banner
Any help is much appreciated! :)
As the documentation that you provided states:
Your error probably is that your passing a negative value to the y parameter, causing the BannerView to be positioned outside of the top border of the Screen.
So, your code should look like this, if you want the banner view to be centered only by height:
Remind that your not taking care of the actual height of the BannerView. To have it centered taking care of its height, this should work:
Banner sizes documentation