Domanda

I have a Linear Layout for advertisement. This Code works great with Ad Mob. The Ad Mob Banner is centered. And it looks good with a Galaxy Nexus and Samsung galaxy y duos. But it doesn't works with InMobi advertisement. On Galaxy Nexus, the Banner is on the Left and on Samsung Galaxy Duos the Banner is on the left and it is a little bit smaller.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/layoutAdView"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="50dp"
        android:layout_centerHorizontal="true"
        android:layout_alignParentBottom="true" >
    </LinearLayout>

</RelativeLayout>

My big Problem is, that the banner is on the Left.

È stato utile?

Soluzione

I solved the Left problem. Change Linear Layout to Relative Layout.

Altri suggerimenti

I was facing the same issue.

Instead of having the parent layout and adding your adView to it, you can define adView in xml As

<com.inmobi.androidsdk.IMAdView android:id="@+id/imAdview" android:layout_width="320dp" android:layout_height="50dp" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" adSize="15" appId="*******************************"/>

Take a instance of it and load the ad. This must probably solve the problem.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top