How to add margins to AdChoises icon in Native Advanced ads?

1,660 views
Skip to first unread message

Vlastimil Brečka

unread,
Jan 28, 2018, 2:54:12 PM1/28/18
to Google Mobile Ads SDK Developers
Hi,
I display native advanced ads. 

ew NativeAdOptions.Builder()
        .setAdChoicesPlacement(NativeAdOptions.ADCHOICES_TOP_RIGHT)

Positions the adchoise icon in the corners. 
This looks bad as it visually ignores padding of my view and therefore looks odd. 
Is there a way to set margins on the icon? Or handle the thing by myself so I can offset it?

Thanks

mobileadssdk-a...@google.com

unread,
Jan 29, 2018, 2:02:18 AM1/29/18
to Vlastimil Brečka, Google Mobile Ads SDK Developers
Hi Vlastimil,

I'm afraid that the only positions available to render the AdChoices icon are the ones outlined in our Native Advanced Guide. However, kindly note that the AdChoices icon is positioned based on the corners of your NativeAdView, so it is possible for you to "move" the Ad Choices icon by adjusting the frame of your NativeAdView.

Let me know if this works for you.

Regards,
Joshua Lagonera
Mobile Ads SDK Team

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/cb96752e-2379-4857-a7c2-215888e5c986%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raunak Yadav

unread,
Apr 23, 2018, 5:29:37 AM4/23/18
to Google Mobile Ads SDK Developers
Hi Joshua,

I am also trying to place the adChoices view a little to the inside of container as I have top and right padding in my view.
The method getAdChoicesView in NativeAdView class always returns null. So setting any layout params on it too doesn't work. Any idea on this?

I don't want to modify the container bounds as I am making use of same layout for native ads from other sdks too.
Let me know if any other workaround is there.


Thanks,

Bharani Cherukuri (Mobile Ads SDK Team)

unread,
Apr 23, 2018, 5:07:18 PM4/23/18
to Google Mobile Ads SDK Developers
Hello, 

Thank you for contacting us. The AdChoices overlay is set to the top right corner by default. Apps can change which corner this overlay is rendered in by setting the setAdChoicesPlacement(). Please refer to this guide for more information. 

Let me know if you have any other questions. 

Regards,
Bharani Cherukuri
Mobile Ads SDK Team

Raunak Yadav

unread,
Apr 24, 2018, 2:05:59 AM4/24/18
to Google Mobile Ads SDK Developers
Hi Bharani,

Its clear to me that I can specify which corner to render but I wanted to give a little margin to the adchoices from that corner so that it is not stuck to the boundary and gets more aligned to the content. For that I need the reference to view but getAdChoicesView method always returns null.

I hope that clarifies the question.

mobileadssdk-a...@google.com

unread,
Apr 24, 2018, 3:14:43 PM4/24/18
to Raunak Yadav, Google Mobile Ads SDK Developers
Hello,
 
Thank you for providing additional details. An AdChoices overlay is added to each ad view by the SDK. The AdChoices icon will be added in the preferred corner of the native ad view. You will be able to adjust the native ad view as per your requirement. You will not be able to move the AdChoices logo. Please take a look this documentation as a reference.

Regards,
Bharani Cherukuri
Mobile Ads SDK Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Reply all
Reply to author
Forward
0 new messages