我有一个工作布局,如下所示:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adUnitId="ca-app-pub-xxx/xxx"
ads:adSize="BANNER"
ads:testDevices="TEST_EMULATOR, xxx"
ads:loadAdOnCreate="true"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
现在我想删除LinearLayout:
<?xml version="1.0" encoding="utf-8"?>
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adUnitId="ca-app-pub-9000079580883391/8483250253"
ads:adSize="BANNER"
ads:testDevices="TEST_EMULATOR, 4FBD7E211FFFF7D7"
ads:loadAdOnCreate="true"/>
Run Code Online (Sandbox Code Playgroud)
然后我面临错误.我知道我需要添加xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"但我不知道在哪里
Sat*_*shi 19
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" 将这两者添加到您的Adview中
| 归档时间: |
|
| 查看次数: |
3522 次 |
| 最近记录: |