【问题标题】:Admob Banner On A Surface View表面视图上的 Admob 横幅
【发布时间】:2014-02-15 15:21:48
【问题描述】:

您知道如何在表面视图中包含 Admob 横幅吗?我尝试了很多小时,但没有成功。

【问题讨论】:

  • 能否添加您已经尝试过的代码?
  • 感谢您的回答! :) 我没有代码了。对不起
  • 认为您应该尝试将 SurfaceView 包装到某个容器并添加标准 AdMob 横幅
  • 好的,你有示例代码吗?
  • 您没有代码了吗?怎么会?

标签: android admob surfaceview


【解决方案1】:

试试这样的

Your_activity.xml

  < ?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:ads="http://schemas.android.com/apk/res-auto"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent">

      <SurfaceView android:layout_width="match_parent"
                  android:layout_height="match_parent"/>

      <com.google.android.gms.ads.AdView android:id="@+id/adView"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             ads:adUnitId="MY_AD_UNIT_ID"
                             android:layout_align_parrent_bottom="true"
                             ads:adSize="BANNER"/>
    </RelativeLayout >

或者从代码创建 AdMob 横幅。更多信息请访问https://developers.google.com/mobile-ads-sdk/docs/admob/fundamentals

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-08-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-24
    相关资源
    最近更新 更多