问题
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?
回答1:
Don't put the iAd view in the UIWebView, make the UIWebView smaller and add the iAd view as a sibling of the UIWebView.
回答2:
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.
回答3:
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]
来源:https://stackoverflow.com/questions/4350824/iad-on-webview-iphone