我有一个UIViewController,它有一个UIView,我在一个nib文件中添加。这是一个iPad项目。我想动画,以便在视图加载时,这个UIView从底部到中心出现,所以我做了以下内容:
[self.containerView_ setFrameY:self.view.bounds.size.height];
[UIView animateWithDuration:0.6 delay:0.0 options:UIViewAnimationCurveEaseOut animations:^{
[self.containerView_ setCenter:CGPointMake(self.view.bounds.size.width/2, self.view.bounds.size.height/2)];
} completion:^(BOOL finished) {
}];
这一切都完美地适用于人像,但是在风景上它已经搞砸了,因为容器视图的x中心并没有真正居中,它有点向左,因此动画不是在y轴上转换,而是在x轴也是..
我认为问题是如果我可以让containerView无论方向如何都会居中,那就可以解决它。我正确设置了自动调整大小的蒙版,使其居中。我认为问题是景观的视图边界仍然是768x1024而不是1024x768。对此有何想法?