Jump to content

Android - TBannerAd overlaps the controls

Recommended Posts



I asked this in Embarcadero forum but nobody replied so I hope to get more lucky in this more active forum.


I'm using severals TBannerAd (Dephi 10.3.3) for testing in my app, those Ads are displayed in TLayouts, I don't like put them in a TForm as parent, in my opinion is not professional, but it is not the expected work, banners overlap controls, also I use a TMultiview and banner always displays front.

Is there any solution to this? or TBannerAd component works is like that.


Many thanks.


Share this post

Link to post

The TBannerAd component creates a native control. Because of the way FireMonkey renders everything to a canvas, native components will always render on top of FireMonkey components. It’s a side-effect of the way it works.


The way I got round this is to hide and show the banner component when in other screens (e.g. tabs of a page control or frames which display as screens depending on your UI architecture), so it doesn’t get it the way when I don’t want it to.

I also suggest including a bottom padding to your multi view menus to push the contents above the banner.


I hope this helps

  • Like 1

Share this post

Link to post

Hello Chris,


Many thanks for your reply.


I've followed your guidelines and they are a good option, also I tested with property ControlType set to Platform of TMultiView control and result is as I want, MultiView is displayed in front of the BannerAd controls.


Now, another problem occurs, when TBannerAd is placed within a VertScrollBox and it moves up or down, a flickering effect is displayed in BannerAd control. Is there any solution?


Many thanks.

Share this post

Link to post

That’s good news. In terms of the banner being in a scroll box, I’m not surprised that it flickers when scrolling as it isn’t really designed to be used like that. I suggest anchoring it to a fixed position on your form if possible.


The flicker is because the FireMonkey code has to recalculate the position when it scrolls and force a re-render of the native control. As FireMonkey isn’t responsible for rendering the banner it can’t use double buffering to smooth the flickering as it would with other controls.


Sorry but if you need it to be in a scroll area then I’m not aware of a solution, but maybe someone else does?

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now