1
我正在切换并正确缩放iAd在portraid和横向模式下,除了从横向模式开始查看时。在这种情况下,iAd保持对应于portraid的较窄宽度。然后在将设备旋转到portraid并回到风景时解决。如何解决它?谢谢。从横向模式启动时,iAd不适合宽度
- (void)viewDidLoad
{
//iAd
adView =[[ADBannerView alloc] initWithFrame:CGRectZero];
adView.requiredContentSizeIdentifiers = [NSSet setWithObjects: ADBannerContentSizeIdentifierPortrait, ADBannerContentSizeIdentifierLandscape, nil];
adView.delegate = self;
[self.view addSubview:adView];
[super viewDidLoad];
}
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)orientation duration:(NSTimeInterval)duration {
if (UIInterfaceOrientationIsPortrait(orientation)) {
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
} else {
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
}
}
现在,当在横向模式下启动大小合适但与人像开始适合像的风景线! – Jaume 2012-02-20 08:57:07
编辑:如果我改变如果和其他内容,所以ADBannerContentSizeIdentifierPortrait景观和反向,它的作品!但我完全不明白,应该按照你的建议工作,不是吗? – Jaume 2012-02-20 09:03:47
它工作正常,直到iOS6所有这些属性都被弃用。现在问题再次提出。 – 2013-03-07 16:10:23