【发布时间】:2014-12-15 16:26:35
【问题描述】:
我正在尝试在我的 Android 应用程序中使用 Adview。但现在我遇到了问题。 这是我的 xml 文件中的代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ListView
android:id="@+id/category_page"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="#A0C3FF"
android:dividerHeight="2dp"
android:layout_marginBottom="30dp" />
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="bottom"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id" >
</com.google.android.gms.ads.AdView>
</FrameLayout>
</LinearLayout>
相同类型的代码在下一个 xml 文件中运行良好。 但不是在这里。 如果我在任何地方做错了,你能告诉我吗,因为我自己找不到。
【问题讨论】: