【发布时间】:2014-01-06 16:25:29
【问题描述】:
我的 iAd 在 iPad(模拟器或真机)上以横幅视图和点击时在 iAd 视图中被放大时遇到了问题。它在 iPhone 上运行良好,只是在 iPad 上不行(当自动缩放时)。
iPhone 应用本身非常简单,布局合理,仅支持纵向。
我知道 currentContentSizeIdentifier 已被弃用,但是在 iOS 7 后的世界中如何处理这个问题?我试过使用
self.canDisplayBannerAds=YES:
...但是还没有弄清楚在使用这个方法时如何设置委托。
这是我的 viewDidLoad 的开始,我在其中添加 iAd 横幅并将其定位到视图的底部。
- (void)viewDidLoad
{
[super viewDidLoad];
//add iAd banner
CGRect myView=self.view.frame; //get the view frame
//offset the banner to place it at bottom of view
CGRect bannerFrame= CGRectOffset(myView, 0, myView.size.height);
//Create the bannerView
ADBannerView *adView = [[ADBannerView alloc] initWithFrame:bannerFrame];
//yes, deprecated, but what to use now?
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
[self.view addSubview:adView];
adView.delegate = self;
...
我很欣赏你在这件事上的智慧,一如既往......
【问题讨论】:
-
你的应用是通用的还是 iphone 应用而 ipad 只是模拟 iphone(带框架)?