-
Notifications
You must be signed in to change notification settings - Fork 317
Customize the color of the white border arround NativeAds #842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @svprdga |
I'm not OP, but was browsing I'm in the process of implementing and was looking around and saw the open post that I also ran into. This is 100% the code from the implementation guide here: https://developers.google.com/admob/flutter/native/templates The below images are what I assume OP is talking about. Left is Android, right is iOS. Note that this only occurs on Android. Just as an addition: On Android, setting the background colors of the Ad to transparent also sets it to whatever that border color is so it seems that whatever container the ad details are in/over has a padding and a bg color. Also the constrained box templates in the code linked above does not auto-expand the height based on if there is a video or not in the small template. EDIT After playing around a bit more and altering the button colors, it appears to be an issue with android padding in general. Android left - iOS right |
Thank @NaMeTaKeN33 for providing more information. I also can see the issue as you described. To reproduce the issue, enable dark theme (
|
We’re closing this issue due to inactivity. If you’re still impacted, please create a new issue via the Developer Forum. |
Lmao why was this closed due to inactivity? It's still an issue considering that there hasn't been a version bump and was on development sides plate. |
@svprdga @NaMeTaKeN33 @huycozy NOTE: after changing it I can change background color in flutter by adding Container or else. |
If you need a less quick and dirty fix that work with your CI environnement Replace
By this forked repo repo
|
For IOS Comment following line
This helps me change the border and color. - (void)applyStyles {
// self.layer.borderColor =
// [GADTTemplateView colorFromHexString:@"E0E0E0"].CGColor;
// self.layer.borderWidth = 1.0f;
[self.mediaView sizeToFit];
if ([self styleForKey:GADTNativeTemplateStyleKeyCornerRadius]) {
float roundedCornerRadius =
((NSNumber *)[self styleForKey:GADTNativeTemplateStyleKeyCornerRadius])
.floatValue;
// Rounded corners
self.iconView.layer.cornerRadius = roundedCornerRadius;
self.iconView.clipsToBounds = YES;
((UIButton *)self.callToActionView).layer.cornerRadius =
roundedCornerRadius;
((UIButton *)self.callToActionView).clipsToBounds = YES;
}
...
} happy coding! |
Use case
The new NativeAd can now be customized with colors from Dart code. However there is a padding space between the ad components and the gray outer boundary which is always white. Right now, even if the app is in Dark mode, that space is white. It would be nice if that white space could be customized, so that it could be put in a Dark tone.
Proposal
Add a
paddingColor
or similar property inNativeTemplateStyle
in order to be able to set the color of that space which right now is always white.The text was updated successfully, but these errors were encountered: