我有一个iAd,它显示在主视图的全屏子视图的顶部。 iAd通常以纵向模式工作,我已将iAd横幅视图的旋转处理为横向模式。用户在横向模式下轻敲iAd时会发生此问题。测试广告以纵向显示,横向显示在手机上,当用户点击x以关闭iAd时,横幅视图及其父视图将被推出屏幕外。 iAd在纵向模式下正常运行(即点击并关闭它会导致包含横幅的视图正常显示)。iAd Landscape奇异视图行为
事情我已经尝试:
- (void)bannerViewActionDidFinish:(ADBannerView *)banner{
NSLog(@"Ad was closed, show the adView again");
if(UIInterfaceOrientationIsLandscape(currentInterfaceOrientation)){
[self animateRotationToLandscape:0.3f];
}
else{
[self animateRotationToPortrait:0.3f];
}
}
-(void)animateRotationToPortrait:(NSTimeInterval)duration{
self.adView.currentContentSizeIdentifier =
ADBannerContentSizeIdentifierPortrait;
BOOL iPad = NO;
#ifdef UI_USER_INTERFACE_IDIOM
iPad = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
#endif
if (iPad) {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:duration];
proUpgradeDescription.frame = CGRectMake(82,313,604,110);
proUpgradePrice.frame = CGRectMake(313,576,142,28);
closeButton.frame = CGRectMake(348,834,72,37);
purchaseButton.frame = CGRectMake(313,431,142,142);
[UIView commitAnimations];
}
else{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:duration];
proUpgradeDescription.frame = CGRectMake(20,80,280,70);
proUpgradePrice.frame = CGRectMake(88,322,142,28);
closeButton.frame = CGRectMake(123,403,72,37);
purchaseButton.frame = CGRectMake(88,172,142,142);
[UIView commitAnimations];
}
}
其中要求,我用动画显示旋转为纵向和横向模式的代码。此代码无效。
如果任何人有任何想法,为什么测试广告不能正确旋转,为什么他们推动父视图控制器关闭屏幕,我将不胜感激。
你的animateRotationToLandscape代码在哪里? – 2012-02-24 01:59:22
@wasabi你提交你的应用程序?他们接受了吗?从应用商店下载广告时,您的广告是否能正确显示 – 4GetFullOf 2014-03-16 16:24:28