2012-04-05 41 views
0

我有一个肖像/ portraitupsidedown应用程序,其中我已经实现了iAds - 这一切似乎都成功,我实现它的页面只是一个图像视图,一堆按钮,所以我把它设置为当广告移动到主视图上方时不移动,但是如果我旋转设备,我会看到横幅可能被遮盖错误。iAd设备旋转导致'可能被遮挡'警告

我只能得到错误每一次页面上的会议,进一步旋转不会导致重复,但如果我去到另一个页面,回来我可以重复警告一次。

如果我让应用程序运行一段时间,广告根据其可用性来来去去而没有警告 - 它看起来好像没有广告在彼此之上。

这可能是一个短暂的故障发生在旋转过程中,有没有什么办法可以进一步诊断?

我已添加[self.view bringSubviewToFront:theBannerView];到动画舞台,但它没有什么区别,真不奇怪,因为它在旋转这就是问题!

回答

0

试试这个:

- (void)changeBannerOrientation:(UIInterfaceOrientation)toOrientation 
{ 

    if (UIInterfaceOrientationIsLandscape(toOrientation)) { 
     self.bannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape; 
    } 

else { 
     self.bannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait; 
    } 
} 

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
     return YES; 
} 

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 
          duration:(NSTimeInterval)duration 
{ 

    if (bannerView) { 
     [self changeBannerOrientation:toInterfaceOrientation]; 
    } 
} 
0

我也碰到过同样的问题。在屏幕方向变化AdView后,不完全在屏幕上,因此“旗帜可以被遮蔽”

为了防止“错误”,你可以删除或隐藏在旋转前AD浏览,并添加它后,

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { 
    [AFAddManager removeFromView]; 
} 
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{ 
    [AFAddManager updateOrientation:self.interfaceOrientation]; 
    [AFAddManager addToView:self.view]; 
} 

但这看起来不太好。您可以用复制的图像替换adview,使其看起来像旋转一样。

我要离开我的应用程序的警告消息。 我认为只要添加是可见的一段时间你得到的印象功劳。只要你的应用程序不是一直在旋转它不是一个问题。 会很高兴有一些确认。

0

我可以确认的现象,我没有得到任何一个方向初始页面加载错误,但我得到它旋转。

我曾尝试隐藏技巧才能消除“错误”,但无济于事。我认为我应该把它说出来,正如马克所说,除非你付出很多努力,否则它看起来很丑。

我对此和苹果文献做了一些阅读,似乎如果广告的一部分被遮盖,新广告将不会被加载,这表明我们获得每个广告加载的功劳,而不是总显示时间。

相关问题