【发布时间】:2011-04-26 02:00:57
【问题描述】:
我有一个 iAd,它显示在主视图的全屏子视图的顶部。 iAd 在纵向模式下正常工作,我已经将 iAd 横幅视图旋转到横向模式。当用户在横向模式下点击 iAd 时会出现此问题。测试广告以纵向、横向显示在手机上,当用户点击 x 关闭 iAd 时,横幅视图及其父视图被推到屏幕外。 iAd 在纵向模式下正常运行(即点击它并关闭它会导致包含横幅的视图正常显示)。
我尝试过的事情:
- (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 代码在哪里?
-
@wasabi 你提交你的应用了吗?他们接受了吗?从应用商店下载时,您的广告是否正确显示?