アプリに Amazon 広告を実装しましたが、iPhone 6 および iPhone 6+ でアプリを実行すると、デバイスに応じて幅が設定されないという問題があります。
これは私のコードです:
self.amazonAdView = [AmazonAdView amazonAdViewWithAdSize:AmazonAdSize_320x50];
options = [AmazonAdOptions options];
// Turn on isTestRequest to load a test ad
options.isTestRequest = YES;
// Register the ViewController with the delegate to receive callbacks.
self.amazonAdView.delegate = self;
// Load an ad
[self.amazonAdView loadAd:options];
// Adjust the ad position on iOS 7 devices due to the new status bar behavior on apps built with iOS 7 SDK
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending) {
self.amazonAdView.frame = CGRectMake(0, 20, self.amazonAdView.frame.size.width, self.amazonAdView.frame.size.height);
}
#endif
self.amazonAdView.frame = CGRectMake(0, self.view.frame.size.height-50, self.view.frame.size.width, self.view.frame.size.height);
[self.view addSubview:self.amazonAdView];
Amazon ドキュメント広告のサイズ固有の広告サイズについては、このリンクを参照しました。
以下は、アプリを実行したときの出力です。デバイスのサイズごとに全幅の広告が必要です。
私はすでに次のコードを試しましたが、動作しません。
self.amazonAdView.frame = CGRectMake(0, self.view.frame.size.height-50, self.view.frame.size.width, self.view.frame.size.height);
Amazon 広告のサイズを設定するのを手伝ってください。
助けていただければ幸いです。