iAd on webview - iphone

2019-09-04 06:08发布

I have a big problem, I have an app with a database, inside this database I stored an html page that i display on a uiwebview...there is a way for put an iAd inside webview?

3条回答
霸刀☆藐视天下
2楼-- · 2019-09-04 06:54

Don't put the iAd view in the UIWebView, make the UIWebView smaller and add the iAd view as a sibling of the UIWebView.

查看更多
地球回转人心会变
3楼-- · 2019-09-04 06:54

Do you want it to scroll? iOS 5 allows access to the scrollView of the UIWebView. You could add the iAd banner to the scrollview.

[webview.scrollView addSubview:banner]
查看更多
仙女界的扛把子
4楼-- · 2019-09-04 07:01

The iAd framework has a didFailToReceiveAdWithError: method that will get called if there is an issue pulling a new ad. If you have an Apple Developer account there is a video from WWDC 2010 that demonstrates how to use iAd. This can be found if you go to: http://developer.apple.com/videos/ which will open iTunes. Then go to WWDC 2010 Sessions -> Application Frameworks -> Session 112 - Integrating Ads with iAds.

This will show you how to move the banner in and out of a view depending on if an ad is loaded correctly.

In your situation you might have something like a UIView that holds both the UIWebView and the ADBannerView. Once an add is correctly loaded you would then shrink the size of the UIWebView enough to display the ADBannerView.

查看更多
登录 后发表回答