不推荐使用iOS 6 iAd属性和方法
自iOS 6发布以来,有一些iAd属性和方法不推荐使用,如:
currentContentSizeIdentifier requiredContentSizeIdentifiers ADBannerContentSizeIdentifierPortrait ADBannerContentSizeIdentifierLandscape
那么现在在两个方向上实现iAd的最好方法是什么? 我们现在应该手动调整横幅视图框架的大小吗?
我有我的应用程序只支持横向模式(也适用于纵向模式),并有应用程序的顶部显示iAd。 为了使这个工作与ios6我不得不这样做:
在Monotouch中
storesAdBannerView = new ADBannerView(); storesAdBannerView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
对于objc(我不使用),我想这可能是
[storesAdBannerView setAutoresizingMask:UIViewAutoresizingFlexibleWidth]
景观广告似乎有些被淘汰。 参见: http : //www.iphonedevsdk.com/forum/iphone-sdk-development/108118-landscape-iad-banners-in-ios-6-edit-landscape-phased-out-completely.html
这需要进一步的确认,因为我找不到有关这个变化的苹果文件。
我有两个解决方法在那里: http : //www.touch-code-magazine.com/iad-code-is-broken-in-ios6/testing第一个解决scheme:
简单的临时解决scheme – 您可以快速让您的应用程序使用便宜的作弊再次编译,显式添加#import到您正在访问currentContentSizeIdentifier和大小名称常量的文件。 这应该让你去,直到你改变你的应用程序使用新的自动布局function。
它在xcode 4.5上正常工作(横幅testing正常)。