【问题标题】:iAd banner doesn't flip with device orientationiAd 横幅不随设备方向翻转
【发布时间】:2014-12-28 20:01:09
【问题描述】:

我的设备方向设置为纵向和倒置。在设备和模拟器上,当我单击纵向中的广告横幅时,广告会以纵向加载。但是,当我将设备倒置时,应用程序会倒置,但 iAd 不会并保持纵向。所以换句话说,倒置的应用程序,iAd 是不能倒置的。如何使用倒置方向应用程序使 iAd 翻转可见?

我使用以下方法使设备方向倒置和纵向。但是我现在如何为 iAd 执行此操作?

 -(NSUInteger)supportedInterfaceOrientations {

return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);

}

我使用以下代码在故事板屏幕顶部添加了 iAd...

 -(void)bannerViewDidLoadAd:(ADBannerView *)banner{

[UIView beginAnimations:nil context:nil];

[UIView setAnimationDuration:1];

[banner setAlpha:1];

[UIView commitAnimations];
 }

【问题讨论】:

  • 如何将 iAd 添加到屏幕 - 使用代码还是通过 Storyboard?在我的脑海中,听起来 iAd 不在对象图中,因此没有接收到界面方向消息。
  • 我在故事板的屏幕顶部添加了 iAd 横幅,并在我的问题中编辑了代码。

标签: ios ios-simulator orientation device iad


【解决方案1】:

此时您只能将 iAd 横幅的设备方向设置为纵向和横向。 iAd 没有颠倒的方向,我相信 AdMob 横幅是一样的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-26
    相关资源
    最近更新 更多