Android AdMob not showing LinearLayout on Bottom

前端 未结 2 430
无人及你
无人及你 2020-12-18 06:12

Okay really weird situation with AdMob. I want to place the ad on the bottom I have a LinearLayout. When I do it never shows up. When I place it on top it shows up perfec

相关标签:
2条回答
  • 2020-12-18 06:57

    This might help too... Admob ads not showing - Android

    As Ted says, the list view may be taking up all available real-estate. Even with wrap_content, if the list is populated with a lot of data before the adView populates, the adView will not be able to expand and place the ad.

    Unless you do what I did and hard code it's height to about 50dp. Not very elegant, but still effective.

    0 讨论(0)
  • 2020-12-18 07:06

    My guess is that your list view fills the screen and is pushing the adview down. Try this xml for the list view:

    <ListView android:id="@android:id/list" 
        android:divider="#00000000" 
        android:layout_width="fill_parent"
        android:layout_height="0px" 
        android:layout_weight="1"
        android:drawSelectorOnTop="false"
        android:background="@android:color/transparent"
        android:cacheColorHint="#00000000"
        android:layout_alignParentTop="true">
        </ListView>
    

    This will give the list view only as much real estate as is available after the image view and ad view claim their share.

    0 讨论(0)
提交回复
热议问题