android - 框架布局内的 Admob 横幅
问题描述
我试图在 framelayout 中插入 admob 横幅但不起作用,任何人都可以帮我插入它,我尝试了很多方法但我找不到解决方案,对此有什么想法吗?
<FrameLayout
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=".MainActivity">
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.FloatingActionButton
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toggle_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp"
android:visibility="gone"
app:backgroundTint="@color/fab_color"
app:fabSize="normal" />
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adUnitId="MY_AD_UNIT_ID"
ads:adSize="BANNER"/>
</FrameLayout>
解决方案
推荐阅读
- reactjs - 如何访问 ReduxSlice 中的状态
- kubernetes - 如何从 HTTP 请求绑定掌舵图中的值?
- r - 有没有办法从 R 中的现有列名生成年份列?
- reactjs - 自动导入类名 Reactjs
- python - @提及随机用户 discord.py
- pandas - 在 Pandas UDF 中运行多个模型时将 SKLearn 模型记录在同一文件夹中
- powershell - 将凭据传递到 powershell 命令
- rust - 在 Rust 中一次从全局哈希图中访问两个可变引用
- azure - Azure 应用程序网关在进行 JMeter 负载测试时随机命中 504 网关超时
- javascript - 为 datetime-local 设置限制,只选择当前日期