我以前问过这个问题,但没有得到一个“足够好”的答案。
我的问题基本上是我不能让Admob在ListActivity中正确显示。
我的布局如下所示:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:myapp="http://schemas.android.com/apk/res/se.javalia.myDrinks"
android:orientation="vertical">
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
<ListView android:id="@+id/android:list" android:layout_alignParentTop="true"
android:layout_width="fill_parent" android:layout_height="wrap_content" />
<TextView android:id="@+id/android:empty"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:text="@string/main_no_items" />
</LinearLayout>
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" >
<com.admob.android.ads.AdView android:id="@+id/ad"
android:layout_alignParentBottom="true"
android:layout_width="fill_parent" android:layout_height="wrap_content"
myapp:backgroundColor="#000000" myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC"
myapp:keywords="drink alcohol wiskey rum soda" myapp:refreshInterval="300" />
</LinearLayout>
</RelativeLayout>现在的问题是,如果我将layout_hight更改为fill_parent或尝试一个大于150px的值,广告将不会显示。当layout_hight为150或更低时,它显示得很好。这样做的目的是让列表在广告占据其位置后填满屏幕。
有什么建议吗?我完全不知道如何解决这个问题。
我将更新问题,如果答案没有得到所有的方式,所以请检查更新。
提前感谢罗兰
发布于 2011-01-30 04:45:00
使用一个RelativeLayout作为外层包装,并将列表视图设置为parent top,将adview设置为parent bottom。
https://stackoverflow.com/questions/4839051
复制相似问题