风景iAd在iOS6中显示肖像图形? [英] Landscape iAd is showing the portrait graphic in iOS6?

查看:111
本文介绍了风景iAd在iOS6中显示肖像图形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序以纵向方向运行,但内部内容随加速度计一起旋转。
我在屏幕底部显示了一个iAd。旋转时iAd改变了位置,但实际界面不旋转(shouldAutorotate返回NO,所有旋转都在OpenGL中处理)。因此iAd定位,然后设置转换以旋转它,这是用户的正确方法。当应用程序位于Portrait中时,它就是纵向广告。在景观中,这是景观。自从iAds首次发布以来,这一直工作得很好。直到现在。

My app runs in the Portrait orientation, but the content inside rotates with the accelerometer. I show an iAd on the bottom of the screen. The iAd changed position as you rotate, but the actual interface does not rotate (shouldAutorotate returns NO, all the rotates are handled in OpenGL). So the iAd is positioned, and then a transform is set to rotate it so it's the correct way up for the user. When the app is in Portrait, it's the portrait ad. When in Landscape, it's the landscape. This has been working perfectly since iAds were first released... til now.

在iOS6中,iAd仍然正确定位,但无论我做什么,内容不是。似乎iOS6 决定它应该显示哪种类型的广告。我认为这与自动调整有关。但我对如何阻止它感到困惑。我最终将横向模式中的肖像图形显示在一边...并且由于广告空间更薄而切断了。

In iOS6, the iAd is still positioned correctly, but no matter what I do, the content is not. It seems like iOS6 decides which type of ad it should show. I think this is to do with the autosizing. But I'm confused about how to stop it. I end up with the portrait graphic being shown in landscape mode... over to one side... and cut off because of the thinner ad space.

还有其他人看到这种行为?它只在iOS6下。有没有人知道如何阻止iAd自动调整大小/旋转内容?

Has anyone else seen this behaviour? It's only under iOS6. Does anyone know how to stop the iAd from auto-sizing/content rotating?

任何帮助都将不胜感激。

Any help would be greatly appreciated.

推荐答案

这可能是由于自动布局,iOS 6的一项新功能。检查故事板的第一个(文件检查器)标签,如果选中使用Autolayout,那就是可能是您的问题!

This may be due to autolayout, a new feature of iOS 6. Check the first ("File Inspector") tab of your storyboard and if "Use Autolayout" is ticked, that's probably your issue!

启用自动布局后,视图基于约束而不是以前可用的简单自动调整大小参数。这些约束覆盖了对子视图框架的大多数尝试更改 - 因此可以解释您的问题。

With autolayout enabled, views are based on 'constraints' instead of the simple autosizing parameters previously available. These contraints override most attempted changes to the frame of subviews - and that would therefore explain your problem.

可以继续使用autolayout并确保正确设置约束,但如果您依靠代码来更改广告视图的位置/尺寸,那么我建议您只需禁用自动布局,再次调整大小正常!

It's possible to continue using autolayout and ensure that your constraints are set correctly, but if you're relying on code to change the position/size of your ad view then I would recommend simply disabling autolayout, which should make your resizing normal again!

这篇关于风景iAd在iOS6中显示肖像图形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆