在ViewController.m中增加
@interface UIWindow (AutoLayoutDebug)
+ (UIWindow *)keyWindow;
- (NSString *)_autolayoutTrace;
@end
//方法
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
NSLog(@"%@", [[UIWindow keyWindow] _autolayoutTrace]);
}
- (void)didRotateFromInterfaceOrientation:
(UIInterfaceOrientation)fromInterfaceOrientation
{
[super didRotateFromInterfaceOrientation:
fromInterfaceOrientation];
NSLog(@"%@", [[UIWindow keyWindow] _autolayoutTrace]);
}
即可在输出中查看