AdMob広告の読み込みに失敗した場合、アプリに組み込まれている自分の広告(ImageView)を表示するレイアウトを作成しようとしています。 リストビューを私の広告を隠さないようにすることはできません。ListView、AdMob、組み込みバックアップ広告レイアウトの問題
AdMob広告だけを使用しても問題はありません。
は、ここに私のレイアウトです。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bgdark"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/actionbarLayout"
android:layout_width="fill_parent"
android:layout_height="@dimen/actionbar_height"
android:layout_alignParentTop="true"
android:layout_marginBottom="2dip"
android:background="@drawable/actionbar_background" >
//Top bar is here
</RelativeLayout>
<LinearLayout
android:id="@+id/layoutAds"
android:layout_width="match_parent"
android:layout_height="50dip"
android:background="#00FF00"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true" >
<ImageView
android:id="@+id/ImageAlternativeAd"
android:layout_width="wrap_content"
android:layout_height="50dip"
android:layout_gravity="center_vertical"
android:src="@drawable/anad"
android:visibility="visible" >
</ImageView>
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
ads:adSize="BANNER"
ads:adUnitId="123456abcd"
ads:loadAdOnCreate="true"
ads:testDevices="TEST_EMULATOR,CFFFFFFF9A836FD749F3EF439CD"
android:visibility="visible" />
</LinearLayout>
<ListView
android:id="@+id/listCategories"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/adView"
android:layout_below="@id/actionbarLayout"
android:cacheColorHint="#00000000" >
</ListView>
を試してみましたhttp://stackoverflow.com/questions/5878283/android-admob-not-showing-linearlayout-on -bottom – kosa
@thinksteepそれは私が思うに役立ちません。私はRelativeLayoutを持っているので、私はlayout_weightを使うことはできません.LinearLayoutへの変更が大きな苦痛になることを恐れています。 – mbwasi