質問

I want to make use of Google AdMob banner in my Android Activity.

I have declared the AdView in my layout.xml to have a default size (ads:adSize="BANNER").

In documentation: https://developers.google.com/mobile-ads-sdk/docs/admob/intermediate#android BANNER is declared to have a size of 320x50.

My device is HTC EVO 3D with size of 960x540.

AdView widget takes approximately 90% of screen width in portrait mode (540).

According to given sizes it should take approximately 50% of the screen.

What happens here ? Can someone explain it ?

役に立ちましたか?

解決

The size for the HTC EVO is 960*540 pixels.

The Admob banner is 320*50 dip (density independent pixels). This is equivalent to the number of pixels that would be used on an mdpi device.

Since the HTC EVO is a hdpi device the banner will get scaled up to 150% of its size so to approximately 480*75 pixels.

You should be thinking and designing in dpi not pixels.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top