UIScrollView returns iOS7 捏合时出错
UIScrollView returns error on pinch on iOS7
我正在使用 UIScrollView 来缩放图像:
override func viewDidLoad() {
super.viewDidLoad()
self.scrollView.minimumZoomScale = 0.5
self.scrollView.maximumZoomScale = 6.0
self.scrollView.contentSize = self.inputImage.frame.size
self.scrollView.delegate = self
inputImage.image = inputImageDelegate
// Do any additional setup after loading the view.
}
func viewForZoomingInScrollView(scrollView: UIScrollView) -> UIView? {
return self.inputImage
}
func scrollViewDidEndZooming(scrollView: UIScrollView, withView view: UIView!, atScale scale: CGFloat) {
//code
}
此代码在 iOS8 中运行良好,但在 iOS7 中出现此错误:
2015-06-18 12:42:20.702 tahrir[96725:607] Unable to simultaneously
satisfy constraints. Probably at least one of the constraints in the
following list is one you don't want. Try this: (1) look at each
constraint and try to figure out which you don't expect; (2) find the
code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you
don't understand, refer to the documentation for the UIView property
translatesAutoresizingMaskIntoConstraints) (
"",
"",
"",
"",
"",
"",
"" )
Will attempt to recover by breaking constraint
Break on objc_exception_throw to catch this in the debugger. The
methods in the UIConstraintBasedLayoutDebugging category on UIView
listed in may also be helpful. done
注意: 我用的是自动布局,没有报错。
删除自动布局限制解决了这个问题。
我正在使用 UIScrollView 来缩放图像:
override func viewDidLoad() {
super.viewDidLoad()
self.scrollView.minimumZoomScale = 0.5
self.scrollView.maximumZoomScale = 6.0
self.scrollView.contentSize = self.inputImage.frame.size
self.scrollView.delegate = self
inputImage.image = inputImageDelegate
// Do any additional setup after loading the view.
}
func viewForZoomingInScrollView(scrollView: UIScrollView) -> UIView? {
return self.inputImage
}
func scrollViewDidEndZooming(scrollView: UIScrollView, withView view: UIView!, atScale scale: CGFloat) {
//code
}
此代码在 iOS8 中运行良好,但在 iOS7 中出现此错误:
2015-06-18 12:42:20.702 tahrir[96725:607] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) ( "", "", "", "", "", "", "" )
Will attempt to recover by breaking constraint
Break on objc_exception_throw to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in may also be helpful. done
注意: 我用的是自动布局,没有报错。
删除自动布局限制解决了这个问题。