gpt4 book ai didi

android - 找不到与给定名称匹配的资源(在 'layout_above' 处,值为 '@id/adView' )。即使在 AdView 拥有该 ID 之后

转载 作者:行者123 更新时间:2023-11-29 14:43:34 24 4
gpt4 key购买 nike

我正在开发一个 Android 应用程序,但在我添加 AdView 后它显示错误 Error:(23, 31) No resource found that matches the given name (at 'layout_above' with value '@id/adView').

XML 代码

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:gravity="center"
android:background="@drawable/bg_lock"
android:layout_width="match_parent"
android:layout_height="match_parent">


<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
android:elevation="4dp" />

<FrameLayout
android:layout_below="@id/toolbar"
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/adView"
android:layout_marginBottom="5dp"/>
<com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
ads:adSize="BANNER"
ads:adUnitId="@string/addUnit" />

</RelativeLayout>

我仍然收到错误。请帮助我

最佳答案

使用android:layout_above="@+id/adView"它会起作用。

关于android - 找不到与给定名称匹配的资源(在 'layout_above' 处,值为 '@id/adView' )。即使在 AdView 拥有该 ID 之后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50622793/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com