我对updateViewConstraints
方法有一些疑问:
updateViewConstraints
在加载视图控制器时被调用了两次?为什么在取消视图控件时调用它?updateViewConstraints
。在iOS 8中它是。现在我在updateViewConstraints
中呼叫willRotateToInterfaceOrientation:duration
,这仅限于iOS 7。updateViewConstraints
中执行此操作,因为在UIDeviceOrientationDidChangeNotification
之后调用updateViewConstraints
。在添加新约束之前,视图必须可用。