私はスタートDeveloping iOS Apps (Swift)チュートリアルでスイフトを学んでいます。私は、このカスタム評価コントロールを作成していますが、私はアプリケーションを実行するたびにエラーをfolowing送信されていない:私は44 == 44 ==ボタンの幅の制約を設定し、ボタンの高さのためにXCode Swift:なぜ制約が崩れるのですか?
2017-08-09 15:49:41.894597+0200 FoodTracker[5051:2273797] [LayoutConstraints] 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.
(
"<NSLayoutConstraint:0x17409af90 UIButton:0x100c12d90.width == 44 (active)>",
"<NSLayoutConstraint:0x17009c160 'UISV-canvas-connection' FoodTracker.RatingControl:0x100c02400.leading == UIButton:0x100c12d90.leading (active)>",
"<NSLayoutConstraint:0x17009c200 'UISV-canvas-connection' H:[UIButton:0x100c12d90]-(0)-| (active, names: '|':FoodTracker.RatingControl:0x100c02400)>",
"<NSLayoutConstraint:0x17009bee0 'UIView-Encapsulated-Layout-Width' FoodTracker.RatingControl:0x100c02400.width == 343 (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x17409af90 UIButton:0x100c12d90.width == 44 (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2017-08-09 15:49:41.895770+0200 FoodTracker[5051:2273797] [LayoutConstraints] 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.
(
"<NSLayoutConstraint:0x17409af40 UIButton:0x100c12d90.height == 44 (active)>",
"<NSLayoutConstraint:0x17009c250 'UISV-canvas-connection' FoodTracker.RatingControl:0x100c02400.top == UIButton:0x100c12d90.top (active)>",
"<NSLayoutConstraint:0x17009c340 'UISV-canvas-connection' V:[UIButton:0x100c12d90]-(0)-| (active, names: '|':FoodTracker.RatingControl:0x100c02400)>",
"<NSLayoutConstraint:0x17009bf30 'UIView-Encapsulated-Layout-Height' FoodTracker.RatingControl:0x100c02400.height == 50 (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x17409af40 UIButton:0x100c12d90.height == 44 (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
が、他のどれも制約。私はチュートリアルで説明したようにすべてを行いましたが、なぜそれがうまくいかないのかわかりません。私は見つけることができるすべての制約をチェックしましたが、私がXcodeでそれほど経験していないようなものであるかどうかはわかりません。誰かが問題を解決するための手がかりを持っていますか?
This is how it should look like: But this is how it looks: (Only The Red Area is important)
お願いします。
エラーメッセージに基づいて、ニコ
は赤い四角/ UIButtonかのUIViewを長方形で? – DonMag
StackView内部のUIButtonです。 –
ああ、私はちょうどあなたが従っているチュートリアルを見てみました.... StackView自体が他の要素を保持する* vertical * StackViewの中にありますか?もしそうなら、* StackViewの 'Alignment'が' Fill'に設定されていますか? – DonMag