我有2个错误,但我修复了一个。我仍然在com.admob.android.ads wats错误解析XML未绑定前缀错误?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
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="wrap_content"
xmlns:backgroundColor="#000000"
xmlns:primaryTextColor="FFFFFF"
xmlns:secondaryTextColor="#CCCCCC"
android:layout_alignParentTop="true"
ads:adUnitId="xxxxxxxxxxxx"
ads:adSize="BANNER"
ads:loadAdOnCreate="true"
/>
</RelativeLayout>
答案 0 :(得分:12)
您需要在主标记(RelativeLayout)上设置布局配置并设置广告的命名空间:
<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"
>