简体   繁体   English

如何更改应用打开广告背景 admob

[英]How to change app open ad background admob

I place the banner ad on the top of the main activity, but when the app switch app open ad shows and violate the AdMob ( policy )我将横幅广告放在主要活动的顶部,但是当应用程序切换应用程序打开广告显示并违反 AdMob (政策

Is that possible to change the background of the app open ad, as you know that by default app open app ad's background is transparent, As a result, when the app open ad shows, the banner ad is also showing in the background.是否可以更改应用打开广告的背景,如您所知,默认情况下应用打开应用广告的背景是透明的,因此,当应用打开广告显示时,横幅广告也显示在背景中。

Finally, After a lot of research, I found the answer,最后,经过大量研究,我找到了答案,

First, create a theme in style.xml or them.xml file( make app open ad background black)首先,在 style.xml 或 them.xml 文件中创建一个主题(使应用打开广告背景为黑色)

 <style name="Theme.AppThemeNoActionBar.AdTheme" >
    <item name="android:background">@color/black</item>
    <item name="android:windowBackground">@color/black</item>
    <item name="android:windowExitAnimation">@null</item>
    <item name="android:windowEnterAnimation">@null</item>
</style>

and declare the activity on the manifest.xml file, and apply the theme并在 manifest.xml 文件中声明活动,并应用主题

 <activity
        android:name="com.google.android.gms.ads.AdActivity"
        android:theme="@style/Theme.AppThemeNoActionBar.AdTheme"
        tools:replace="android:theme"/>

I know its the best practices.我知道它的最佳实践。 But have you get any message from AdMob about it?但是您有没有收到来自 AdMob 的任何消息?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM