【问题标题】:Apple's iAd doesn't look good on device/simulatorApple 的 iAd 在设备/模拟器上看起来不太好
【发布时间】:2015-01-08 08:14:05
【问题描述】:

这就是我的 iAd 在设备/模拟器上的外观。每次都会发生。横幅的实际大小是正确的,但内容大小是错误的(您可以在我的图片上看到它)。 也许,当应用上线时,这个问题会得到解决?任何帮助,谢谢。

我的应用使用 cocos2d v2.1,仅限横向。

这是我的 createBanner 代码:

 _adBannerView = [[ADBannerView alloc] initWithFrame:CGRectZero];
_adBannerView.delegate = self;

    CGSize sizeToFit = [_adBannerView sizeThatFits:[[CCDirector sharedDirector] view].frame.size];
[_adBannerView setFrame:CGRectMake(([[CCDirector sharedDirector] view].frame.size.width - sizeToFit.width)/2.0f, 0, sizeToFit.width, sizeToFit.height)];

[_adBannerView setAutoresizingMask:UIViewAutoresizingFlexibleWidth];

CGRect frame = _adBannerView.frame;
frame.origin.y = -frame.size.height;
frame.origin.x = 0.0f;

_adBannerView.frame = frame;

AppController * myDelegate = (((AppController*) [UIApplication sharedApplication].delegate));
[myDelegate.navController.view addSubview:self.adBannerView];

【问题讨论】:

    标签: ios iphone cocos2d-iphone iad


    【解决方案1】:

    好的,我解决了。 当您可以使用 LaunchImage.xib 而不是资产目录时,问题在于新的 iOS 8 功能。当您使用可调整大小的 .xib 文件时,它可以完美运行,但 iAd 不会响应您处于横向模式。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-09
      • 1970-01-01
      • 2015-06-18
      • 1970-01-01
      • 2019-09-24
      相关资源
      最近更新 更多