Hi,
I'm trying to work out how much of the screen (in pixels) my Admob smart banner will take up in height on various devices. I have a smart banner at the top of my game. While Smart Banners automatically take care of the width, I need to know the height. From the Admob page I see this:
Ad height | Screen height |
---|
32 dp | ≤ 400 dp |
50 dp | > 400 dp and ≤ 720 dp |
90 dp | > 720 dp |
I need to know exactly how tall in screen pixels the ad will be so I can calculate exactly how much of the rest of the screen can be used as playable space for my game.
I've seen some articles showing the formula to calculate screen pixels is: px = dp * (dpi / 160)
I have an iPhone 8 which I'm testing on. It has a 750x1334 resolution and 326 dpi.
According to this information, I'm calculating the pixel height of a smart banner on my iPhone 8 should be 65.2. Formula: 32 * (326 / 160) = 65.2 px.
However, the ad on device looks like it's taking up around 100 pixels in height.
What am I doing wrong, and what's the correct formula to calculate this?
Many thanks,
Ben