How ro place admob at the bottom

straybullet

Member
Licensed User
Longtime User
Is there an easy way to have admob at the book of the screen (perhaps centered). I have it running , but the ad is using the tutorial settings and is at the top.

I would like to have it at the bottom, even when the screen is rotated, place it at the bottom

Any help will be greatly appreciated.
 

NJDude

Expert
Licensed User
Longtime User
Assuming the Ad is on the Activity:

B4X:
Activity.AddView(myAdMob, 0dip, Activity.Height - 50dip, 320dip, 50dip)

That will place the Ad at the bottom regardless of orientation.
 
Last edited:
Upvote 0

straybullet

Member
Licensed User
Longtime User
Thanks, I figured out how to do it a little different, but both seem to work. Now to get it centered.

Here is what I used...
Activity.AddView(AdView1, 0dip, 100%y-50, 320dip, 50dip)

I tried using
Dim adplace as int
Dim layoutVal As LayoutValues

adplace = layoutval.Width /2 -60

get figure out the center values but never would work
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…