简体   繁体   中英

iAd on webview - iphone

我有一个大问题,我有一个带有数据库的应用程序,在该数据库中,我存储了一个显示在uiwebview上的html页面...是否可以将iAd放在webview中?

请勿将iAd视图放入UIWebView中,而是将UIWebView缩小,然后将iAd视图添加为UIWebView的同级对象。

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]

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM