开发者

android admob not showing up- screen size too small

I have a webview and an admob ad onthe bottom. It is getting the ad but not displaying it because the screen is too Small. Previosuly , when I ran it in just a linear layout the ad would show up fine.

Here is the code i have now:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 
android:id="@+id/relativeLayout1" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:orientation="vertical">
<com.google.ads.AdView
android:id="@+id/ad"
android:开发者_StackOverflowlayout_width="fill_parent" 
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
ads:adUnitId="a14e0b54f42c7c7"
ads:adSize="BANNER"
ads:loadAdOnCreate="true"/>
     <WebView
    android:id="@+id/sdrwebview"
     android:layout_width="fill_parent"
      android:layout_above="@+id/ad" 
      android:layout_height="fill_parent"/>
</RelativeLayout>


Try swapping the views around... your Webview is probably covering the Adview

<RelativeLayout...>
     <WebView.../>
     <com.google.ads.AdView.../>
</RelativeLayout>


See the AdMob documentation. https://developers.google.com/mobile-ads-sdk/docs/admob/intermediate#play

The SDK will request whatever size the requesting AdView was instantiated with. If there isn't enough space on the device's screen to display the ad, nothing will be shown.

Maybe the AdMob SDK doesn't support smaller screens than 320x50.


Try use the following

ads:adSize="SMART_BANNER"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜