gpt4 book ai didi

ios - UIScrollView 在 iOS7 上捏合时返回错误

转载 作者:行者123 更新时间:2023-11-30 14:17:51 25 4
gpt4 key购买 nike

我使用 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

注意:我使用的是自动布局,并且没有错误。

最佳答案

删除自动布局约束解决了该问题。

关于ios - UIScrollView 在 iOS7 上捏合时返回错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30909897/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com