gpt4 book ai didi

iphone - iOS 自定义 View : Unable to simultaneously satisfy constraints error

转载 作者:可可西里 更新时间:2023-11-01 05:13:22 25 4
gpt4 key购买 nike

我正在学习 Ray Wenderlich 关于实现 rateView 的教程:http://www.raywenderlich.com/1768/how-to-make-a-custom-uiview-a-5-star-rating-view

在我的应用中实现 rateView 后,我收到了这个错误:

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)

( "NSAutoresizingMaskLayoutConstraint:0x870c2b0 h=--& v=--& V:[UIView:0x93a1d60(416)]", "NSLayoutConstraint:0x87363c0 V:|-(203)-[RateView:0x8729040] (Names: '|':UIView:0x93a1d60 )", "NSLayoutConstraint:0x8736440 V:[RateView:0x8729040]-(228)-| (Names: '|':UIView:0x93a1d60 )" )

Will attempt to recover by breaking constraint NSLayoutConstraint:0x8736440 V:[RateView:0x8729040]-(228)-| (Names: '|':UIView:0x93a1d60 )

Break on objc_exception_throw to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in UIKit/UIView.h may also be helpful.

我下载了 Ray 提供的示例应用程序,它非常适合我,没有错误。搜索代码后,我没有看到任何差异,我在 Interface Builder 中的连接与他的相同。一个显着的区别是我们个人利率观点的尺寸检查员。他的样子是这样的:

enter image description here

虽然我的看起来像这样:

enter image description here

考虑到错误与约束有关,这可能就是问题所在。但是,我不知道如何将我的评分 View 更改为自动调整大小,例如 Ray 的。帮忙?

最佳答案

取消选中“使用自动版式”并尝试...

enter image description here

关于iphone - iOS 自定义 View : Unable to simultaneously satisfy constraints error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17271264/

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