I would like to be able to do this as well, but so far I have not
found any way to accomplish this via XML or using the AdMob SDK
alone.
One thing I ended up doing was to wrap all of my AdViews in a custom
Layout I called AdWrapper. Then, I overrode AdWrapper's onDispatchDraw
method (which is fired when its children are drawn and provides a
Canvas object to manipulate) and called Canvas.rotate on the AdView's
drawing canvas.
By doing this, I was indeed able to get the ad to be oriented
vertically, but there were several other caveats. For one the area of
the ad which responded to clicks of course did not line up with how it
was displayed on-screen. Also, most of the rotated ad would fall
outside the bounds of my wrapper view, so it was clipped.
The second issue, I figure could be easily remedied by making the
wrapper view a sort of overlay that fills the screen, but I was not
able to find a way to get the ad to respond to click events
appropriately after the redraw.
I had a crazy idea of intercepting the AdView's touch events (using my
overlay AdWrapper) and setting up some logic to ignore clicks in the
AdView's old bounds and simulate a click for the new bounds, but this
seemed like it might have been close to a ToS violation so I didn't
try it. Actually, I'm not even sure if displaying the ads vertically
isn't against the ToS, since I know advertising companies are fairly
strict about placement and appearance.
I'd love to hear if anyone else was successful, or this is even
allowed?
On May 17, 3:56 am, qureei <
eirij.qure...@gmail.com> wrote:
> Is there a way to show ads vertically in landscape mode in an Android game?
> Something like the following:
>
>
http://stackoverflow.com/questions/5684097/how-to-show-admob-ads-vert...