@ + ID / AD浏览"是红色的,为什么呢? [英] @+id/adView" is red, why?

查看:298
本文介绍了@ + ID / AD浏览"是红色的,为什么呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MyActivity"
android:background="#ff000640">

<WebView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/webView"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true"

    android:layout_alignParentTop="true"
    android:layout_above="@+id/adView"
   />

<com.google.android.gms.ads.AdView android:id="@+id/adView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    ads:adUnitId="ca-app-pub"
    ads:adSize="BANNER"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    />

为什么是红色?当我运行应用程序AdView的工作就好了,所以我不知道为什么它不会工作。红色部分也消失了一小会儿,一旦我运行应用程序。
当我在上面改变它下面没有给出误差

Why is it red? When I run the app the adview works just fine so I have no idea why it wouldn't be working. The red part also disappears for a short while once I run the app. when I change above to below it gives no error

推荐答案

我觉得你没有导入谷歌AdMob联播库。请输入这个库到您的项目,然后再试一次。 点击这里

I think you didn't import Google Admob Library. Please import this library into your project and try again. Click Here

由于当我尝试你的code,任何红线出现。只需导入库。

Because when I try your code, any red lines appear. Just import the library.

这篇关于@ + ID / AD浏览&QUOT;是红色的,为什么呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆