简体   繁体   English

在iOS 6.0中调整AdBannerView的大小

[英]Resizing AdBannerView in iOS 6.0

Using an AdBannerView, I'm confused about how to respond to device orientation changes under iOS 6.0. 使用AdBannerView,我对如何响应iOS 6.0下的设备方向变化感到困惑。 I haven't used iAd before, but it seems that the relevant properties and methods that were used in earlier releases are now deprecated. 我以前没有使用过iAd,但现在似乎已弃用了早期版本中使用的相关属性和方法。 (These being currentContentSizeIdentifier and sizeFromBannerContentSizeIdentifier: , plus a small number of others.) (这些是currentContentSizeIdentifiersizeFromBannerContentSizeIdentifier:还有少量其他。)

Also, two of the NSString content size identifiers constants have been deprecated and replaced by two others. 另外,两个NSString内容大小标识符常量已被弃用,并被其他两个替换。 But there are no properties of methods that I can see where they are used in iOS 6.0. 但是没有方法的属性,我可以看到它们在iOS 6.0中的使用位置。

Can someone provide a brief tutorial or link to one that explains how this works in iOS 6.0? 有人可以提供简短的教程或链接,以解释在iOS 6.0中如何工作吗? Existing tutorials that aren't written for iOS 6.0 don't cover this, as far as I can tell. 据我所知,没有为iOS 6.0编写的现有教程并未涵盖这一点。

I've been trying to update an app with ads and I've noticed some pretty unintuitive behavior myself. 我一直在尝试用广告更新应用程序,而我自己也发现了一些非常不直观的行为。 Look at the XIB in landscape on a 4in form factor shows the ad going only partially across the page, but when run in simulator or on device it works like expected. 在尺寸为4英寸的外观上查看XIB的情况下,广告只能部分显示在整个页面上,但是在模拟器或设备上运行时,它的运行效果与预期的一样。

As for the question, I'm still using currentContentSizeIdentifier (which is deprecated) and setting it as either ADBannerContentSizeIdentifierPortrait or ADBannerContentSizeIdentifierLandscape (which are not deprecated). 至于问题,我仍在使用currentContentSizeIdentifier (已弃用),并将其设置为ADBannerContentSizeIdentifierPortraitADBannerContentSizeIdentifierLandscape (未弃用)。

I've searched the API and don't see any other way to set it. 我已经搜索了API,但没有其他设置方法。 NSURLConnection is another place where I've wound up using deprecated API because no replacement API exists. NSURLConnection是我使用不推荐使用的API的另一个地方,因为不存在替代API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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