且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

自动版式CGAffineTransform iOS7 iOS8上

更新时间:2023-02-03 09:16:28

CGAffineTransformIdentity行为不同的ios7和iOS8上。这与自动布局和大小班做。解决的办法是去除约束,与上ios7动画冲突

CGAffineTransformIdentity behaves differently on ios7 and ios8. This has to do with auto-layout and size classes. The solution is to remove constraints that conflict with the animation on ios7.

// solve the constraint-animation problem
if(NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_7_1) {
    // iOS7 remove constraints that conflict with animation
    if (self.centerYAlignment != nil) {
    self.view.removeConstraint(self.centerYAlignment) //is an IBOutlet 
    }
} else {
    // iOS8 constraint animations are fine
}