Android Question AdMob Height error

gerredtor

Active Member
Licensed User
Hi, i have got a Little Problem with admob. If i add an ad then just have of it can be seen (just the upper half, altough I took the bottom as reference). If I take the size then two times so that everything can be seen then the upper end is not the the view end but the view end is about more then half to the upside, which doesnt make sense to me because I am using this script to determine the height:

B4X:
  ad.Initialize2("adView", "my-key", ad.SIZE_SMART_BANNER)

   Panel1.AddView(ad,0,Height-(getAdMobHeight+getAdMobHeight), Width, getAdMobHeight+getAdMobHeight)

   ad.LoadAd


Sub getAdMobHeight As Float
    Dim h As Int
    If GetDeviceLayoutValues.ApproximateScreenSize < 6 Then
       'phones
       If 100%x > 100%y Then h = 32dip Else h = 50dip
      
      
    Else
       'tablets
       h = 90dip
    End If
   
    Return h
End Sub

the black edge on the downside is the endge of admob
 

Attachments

  • admob.jpg
    admob.jpg
    122.5 KB · Views: 173
Top