任何人都知道用什么来替换 ios 6 的 requiredContentSizeIdentifiers、ADBannerContentSizeIdentifierPortrait 和 currentContentSizeIdentifier?
问问题
1390 次
2 回答
0
您需要使用以下代码行
TabAdvert.AutoresizingMask = UIViewAutoresizing.All;
(标签广告是你 BannerAdView 的名字)
于 2013-01-23T09:06:42.530 回答
0
@ Dave123 从 iOS 6.0 开始,横幅将根据其宽度自动调整大小。然而,为了支持 iOS 5.0,我们继续适当地设置 currentContentSizeIdentifier。作为
CGRect contentFrame = self.view.bounds;
if (contentFrame.size.width < contentFrame.size.height) {
_bannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
} else {
_bannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
}
只需在使用 ios 5.0 时编写代码,在 ios 6.0 中它会自行完成所有其他工作。
于 2013-03-20T06:04:18.663 回答