我遵循了本指南 https://developers.google.com/admob/android/native/mute-this-ad
我使用了 github googlesamples 中的这段代码,使 Native Ad 静音。
但是我怎样才能获得与第一张图片中相同的对话框呢?现在我得到一个简单的对话,说明原因。
这就是我想要的
这就是我按照指南并使用来自 googlesamples 的代码后得到的结果
最佳答案
GoogleSamples 仅提供实现“静音广告”选项的方法。不是用户界面。
从他们的示例中,您只收到默认短标签(如“不合适”、“重复”...)并使用 android.R.layout.simple_list_item_1
是只有 TextView
小部件的默认列表项。作为第一张图片,在生产中他们应该使用自定义字符串和他们自己的用户界面。根据您链接的文档:
The implementation of the custom mute interface is entirely up to you. You can place a small close button on the ad, or you can provide some other interface for the user to opt to mute the ad.
解决方案可能是将 MuteThisAdReasonWrapper
中带有您自己的标签的原因映射到 toString()
中,并使用自定义列表项而不是 simple_list_item_1
.
关于java - 如何显示用于静音原生广告的谷歌表单?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58683254/