Android – google.ads.adview does not occupy the full screen width of Samsung Galaxy notes

In fact, I display a google.ads.adview in the application at the bottom of the screen.. everything is normal. But the only problem is that it does not occupy the whole width of the screen when it is displayed in the notes of Samsung Galaxy, but it needs the whole width of the screen to display it in nexus

Why did this happen? Is there a way to solve this problem

I put my google.ads.adview in my XML layout

<LinearLayout
    android:id="@+id/bottom_control_bar"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:orientation="horizontal" >

    <com.google.ads.AdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ads:adSize="BANNER"
        ads:adUnitId="a14e5222d46c63d"
        ads:loadAdOnCreate="true" >
    </com.google.ads.AdView>
</LinearLayout>

resolvent:

The width of adview varies according to the adsize property. You can https://developers.google.com/mobile-ads-sdk/docs/admob/android/banner#banner_ Check various values of this attribute in size. If you are using v6.0.0 or later abmob, you can use smart_ Banner constant

    <com.google.ads.AdView android:id="@+id/adView"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     ads:adUnitId="yourAdUnitId"                         
                     ads:adSize="SMART_BANNER"
                     ads:loadAdOnCreate="true"/>

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>