我正在尝试使用transitionFromView
[UIView transitionFromView:fromView
toView:weakSelf.logoFlipTurnPhoneAnimationImageView
duration:0.6
options:UIViewAnimationOptionTransitionFlipFromBottom
completion:^(BOOL finished)
{}
它适用于ios7但在转换后的ios8中,视图框可能会受到约束的移动(在superview中看不见的区域)。
我在
之前和之后打印了约束数组之前:
"<NSLayoutConstraint:0x78f0cc60 V:[UIImageView:0x78f0c070(113)]>",
"<NSLayoutConstraint:0x78f0cc90 H:[UIImageView:0x78f0c070(113)]>"
后
"<NSLayoutConstraint:0x78f0cc60 V:[UIImageView:0x78f0c070(113)]>",
"<NSLayoutConstraint:0x78f0cc90 H:[UIImageView:0x78f0c070(113)]>",
"<NSContentSizeLayoutConstraint:0x79216d00 H:[UIImageView:0x78f0c070(113)] Hug:250 CompressionResistance:750>",
"<NSContentSizeLayoutConstraint:0x7b86aaf0 V:[UIImageView:0x78f0c070(113)] Hug:250 CompressionResistance:750>"
知道为什么要添加两个约束,以及为什么会导致问题?
答案 0 :(得分:0)
在storyboard或xib中选择视图,然后选择要设置约束的视图。然后重置为建议的约束