2017-4-3 UIScrollView的屏幕适应

// 检测设备旋转方向
NotificationCenter.default.addObserver(self, selector: #selector(receivedRotation), name: .UIDeviceOrientationDidChange, object: nil)
//通知监听触发的方法
func receivedRotation(){
    sv.contentSize = CGSize(width: self.view.bounds.width, height: self.view.bounds.height*4.25)
}

你可能感兴趣的:(2017-4-3 UIScrollView的屏幕适应)