开发者

iAd on webview - iphone

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 web开发者_如何学JAVAview?


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


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.


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]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜