[英]Modal View Controller don't rotate correctly
On the ipad, in ios objective C, I am having problems with the rotation moves in one modal view. 在ipad的ipad上,在ios目标C中,我在一种模式视图中遇到了旋转移动的问题。 I give the position of the element in the
shouldAutoRotate
method and its parent view can rotate too, but when I rotate the modal view the elements don't put in the correct place. 我在
shouldAutoRotate
方法中给出了元素的位置,并且它的父视图也可以旋转,但是当我旋转模式视图时,元素没有放在正确的位置。
For more information, if I open the view in portrait mode I get this data: 有关更多信息,如果我以纵向模式打开视图,则会得到以下数据:
<UIView: 0x72bc160; frame = (0 0; 768 1004); clipsToBounds = YES;
autoresize = W+H; layer = <CALayer: 0x13f324f0>
And in landscape mode: 在横向模式下:
<UIView: 0x1358f3b0; frame = (0 0; 768 748); clipsToBounds = YES;
autoresize = W+H; layer = <CALayer: 0x1358f3e0>>
But if I rotate the view the horizontal frame changes by vertical frame... 但是如果我旋转视图,则水平框架会随垂直框架而变化...
Am I doing something wrong? 难道我做错了什么?
I've had a lot of fun with view controller rotation. 视图控制器旋转给我带来了很多乐趣。 There are two things to keep in mind:
有两件事要牢记:
When these things happened to me, it was because the view controllers in the background got the rotation events, but the particular view controller I was presenting from was ignoring them and not passing them along to the modal view controller, leading to inconsistency. 当这些事情发生在我身上时,是因为在后台的视图控制器收到了旋转事件,但是我要呈现的特定视图控制器却忽略了它们,而没有将它们传递给模态视图控制器,从而导致了不一致。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.