Prevent iOS Banner Ad View scrolls

850 views
Skip to first unread message

George Lai

unread,
Aug 12, 2013, 8:28:02 PM8/12/13
to google-adm...@googlegroups.com
Is there any appropriate way to prevent a GAD/DFPBannerAdView from scrolling itself when a tap-drag is applied on it?
From the dfpshowcase sample project all but the mediation banner ad do scroll under drag, which is an unwanted default behavior. This behavior however does not appear on the android sdk for example.

Drew Olbrich

unread,
Aug 30, 2013, 11:11:55 AM8/30/13
to google-adm...@googlegroups.com
On Monday, August 12, 2013 5:28:02 PM UTC-7, George Lai wrote:
Is there any appropriate way to prevent a GAD/DFPBannerAdView from scrolling itself when a tap-drag is applied on it?
From the dfpshowcase sample project all but the mediation banner ad do scroll under drag, which is an unwanted default behavior. This behavior however does not appear on the android sdk for example.

I don't know how kosher this is, but I disabled the banner scrolling by adding this code to the adViewDidReceiveAd method of my GADBannerViewDelegate:

    if ([_bannerView.mediatedAdView isKindOfClass:[GADBannerView class]]) {

        // The AdMob banner ads scroll vertically if you drag your finger across them and it looks lame.

        // This disables that.

        [self preventGADBannerViewBounceScrolling:(GADBannerView *) _bannerView.mediatedAdView];

    }


and then I also define:

- (void)preventGADBannerViewBounceScrolling:(GADBannerView*)bannerView {

    for (UIWebView *webView in bannerView.subviews) {

        if ([webView isKindOfClass:[UIWebView class]]) {

            webView.scrollView.bounces = NO;

        }

    }

}


Hope this helps you. I have only tested this in my app during development and it has not yet been released to the App Store, so no guarantees.

It'd be great if the iOS AdMob SDK disabled the bounce scrolling itself.

Drew

Aman Prajapati

unread,
Feb 17, 2016, 3:23:02 AM2/17/16
to Google Mobile Ads SDK Developers
Hello Lai,
I am not getting any subclass as UIWebview so can't set scrolling stop.
I am getting subclass is only GADADSize, So how can I stop scrolling.
Reply all
Reply to author
Forward
0 new messages