Android广告尺寸(智能横幅并非始终有效)

Android广告尺寸(智能横幅并非始终有效),第1张

概述我遇到了一个非常烦人的adMob问题及其横幅尺寸.智能横幅的尺寸实在是一件好事,它几乎可以为您做任何事情,与调整广告大小有关,但几乎没有.在googledocs中有一个表格,列出了smartbanner支持的大小.支持许多尺寸,但不支持普通android手机的横向尺寸.https://developers.google.com

我遇到了一个非常烦人的adMob问题及其横幅尺寸.
智能横幅的尺寸实在是一件好事,它几乎可以为您做任何事情,与调整广告大小有关,但几乎没有.

在Google docs中有一个表格,列出了smartbanner支持的大小.
支持许多尺寸,但不支持普通android手机的横向尺寸.
https://developers.google.com/mobile-ads-sdk/android-legacy/docs/admob/smart-banners

那就是现在的样子:
人像-一切都很好

景观-不工作

那么,有什么方法可以正确显示横向广告吗?
(这是针对ads:adSize =“ SMART_BANNER”的,当我使用ads:adSize =“ BANNER”时,它会同时显示在两者上,但其固定为ads:adSize =“ BANNER”给您的尺寸,因此在更大的屏幕)

XML格式

<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"    androID:paddingtop="@dimen/activity_vertical_margin"    androID:background="@color/main_bg_color"    androID:ID="@+ID/rel_bg_home"><linearLayout        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent"        androID:orIEntation="vertical"        androID:weightSum="1"        androID:layout_centerInParent="true"        >        <TextVIEw            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:text="Test"            androID:textSize="50sp"            androID:ID="@+ID/uber"            androID:shadowcolor="#000000"            androID:shadowRadius="5"            androID:textStyle="bold"            androID:textcolor="@color/text_color"            androID:layout_gravity="center_horizontal"            androID:layout_weight="0.20"            androID:gravity="center|bottom" />        <linearLayout            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:orIEntation="vertical"            androID:layout_gravity="bottom|center_horizontal"            androID:layout_weight="0.30"            androID:gravity="bottom">            <button                androID:layout_wIDth="90dp"                androID:layout_height="wrap_content"                androID:text="Play"                androID:ID="@+ID/play"                androID:textcolor="@color/text_color"                androID:layout_marginBottom="20dp" />            <button                androID:layout_wIDth="90dp"                androID:layout_height="wrap_content"                androID:text="Help"                androID:ID="@+ID/help"                androID:textcolor="@color/text_color"                androID:layout_below="@+ID/play"                androID:layout_marginBottom="20dp" />            <button                androID:layout_wIDth="90dp"                androID:layout_height="wrap_content"                androID:text="score"                androID:textcolor="@color/text_color"                androID:ID="@+ID/score" />        </linearLayout>    </linearLayout>    <Imagebutton        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        androID:background="@drawable/ic_action_achIEvement"        androID:layout_alignParentleft="true"        androID:layout_alignBottom="@+ID/toggle"        androID:layout_aligntop="@+ID/toggle"        androID:layout_marginleft="@dimen/activity_horizontal_margin"        androID:ID="@+ID/highscore"/>    <Togglebutton        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        androID:ID="@+ID/toggle"        androID:minHeight="10dp"        androID:minWIDth="10dp"        androID:background="@drawable/check"        androID:layout_alignParentRight="true"        androID:focusable="false"        androID:focusableIntouchMode="false"        androID:textOn=""        androID:textOff=""        androID:layout_marginRight="@dimen/activity_horizontal_margin"        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"        androID:layout_centerHorizontal="true"        androID:layout_alignParentBottom="true"        ads:adSize="SMART_BANNER"        ads:adUnitID="@string/banner_ad_unit_ID1">    </com.Google.androID.gms.ads.AdVIEw></relativeLayout>

解决方法:

尝试从xml文件的父视图中删除任何边距或填充属性.

希望这对您有所帮助.

总结

以上是内存溢出为你收集整理的Android广告尺寸(智能横幅并非始终有效)全部内容,希望文章能够帮你解决Android广告尺寸(智能横幅并非始终有效)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1120729.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-29
下一篇2022-05-29

发表评论

登录后才能评论

评论列表(0条)

    保存