1、打开横竖屏开关

2、因为屏幕翻转后width和height是相反的
/**屏幕翻转后width和height互换*/
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
_imageView.frame = CGRectMake(0, 0, size.width, size.height);
}
github地址:https://github.com/WangJxin1992/Demo.git
后续待完善!
网友评论