AdMob orientation problem in Android
My application integrates with AdMob ads. When I change the orientation it should fit the screen depending on orientation. In portrait mode it is working fine, but when I changed to landscape mode the ad size I am getting in por开发者_C百科trait mode is the same size of the ad displayed in landscape mode.
I am adding the following in layout page.
<com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
myapp:backgroundColor="#000000"
myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC"
/>
It seem that the answer here is from admob:
http://groups.google.com/group/admob-publisher-discuss/browse_thread/thread/17451c55258de1ec?pli=1
Unfortunately we don't support 480 dip wide ads at this time. We have unified the presentation of our ads across the network, and we have not extended our ad formats to a 480 pixels wide format at this time. We hope to add support for them soon. Our SDK is built in such a way that when we introduce the wider ad unit for landscape phones and other larger screens, the new ads will already be supported and you will not need to update to a new SDK.
So unfortunately, seem impossible to stretch the ads.
I have the same issue but didn't fix it yet.
I was thinking of adding Admob's AdView
inside a LinearLayout
with the exact same backgroundColor
.
Something like:
<LinearLayout android:id="@+id/admob_stuff"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#000000">
<com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
myapp:backgroundColor="#000000"
myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC"
/>
</LinearLayout>
精彩评论