【发布时间】:2010-09-01 08:48:49
【问题描述】:
我的广告根本没有展示,我认为我正确地遵循了文档,但它们仍然不会展示。该程序基本上是一个 webview,我希望广告显示在底部。
这是我的布局文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res/man.utd.headlines"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
myapp:backgroundColor="#000000"
myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC" />
</LinearLayout>
有什么想法吗?
编辑:这是我现在拥有的,但似乎仍然不太正确:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res/man.utd.headlines"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
myapp:backgroundColor="#000000"
myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC" />
<WebView
android:id="@+id/webview"
android:layout_above="@id/ad"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</RelativeLayout>
【问题讨论】:
-
您的布局看起来不正确。你的 webview 占据了整个屏幕。尝试切换 webview 和 adview 并将 adview 的高度更改为 wrap_content 而不是 fill_parent。
-
Admob中的一个错误可能是!