IOS custom view: unable to satisfy error limits at the same time

I follow Ray Wenderlich's guide on implementing rateView: http://www.raywenderlich.com/1768/how-to-make-a-custom-uiview-a-5-star-rating-view

After embedding rateView in my application, I got this error:

It is not possible to simultaneously satisfy the constraints. Probably at least one of the restrictions in the following list is one that you do not want. Try this: (1) look at each constraint and try to figure out what you are not expecting; (2) find the code that added unwanted restrictions or restrictions and fix it. (Note: If you see NSAutoresizingMaskLayoutConstraints that you do not understand, refer to the documentation for the UIView property translated into AutoresizingMaskIntoConstraints)

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

Will try to recover, violating the restriction 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 in UIView, listed in UIKit / UIView.h, can also be useful.

I downloaded an example application that Ray provides, and it works great for me, no errors. After searching for the code, I see no differences, and my connections in Interface Builder are the same as mine. One significant difference was the size inspector for our individual forecasts. It looks like this:

enter image description here

while mine looks like this:

enter image description here

Given that the error is related to limitations, this is probably the problem. However, I do not know how to change my course to be autoresistant, and such as Ray. Help?

+4
source share
4 answers

Uncheck "Use self-timer" and try to execute.

enter image description here

+4
source

The new Xcode 5 has a new function that expects us from different constant values. I really appreciate this feature, it reduces errors and differences between them in the storyboard and what's in the simulator and / or device.

Try to follow the yellow triangle. It is located in the left sidebar when the storyboard viewer opens. He brings three solutions to how to fix the problem, and everything goes well and automatically.

So just upgrade Frame, Constraints, or reset to the suggested limits.

DECISION:

(if you do not see the left sidebar , in the new xcode 5 it can be hidden, just click the play icon ):

shows up the left storyboard side bar

First follow the yellow arrow:

Follow the yellow arrow first

Then follow the yellow triangle, and after clicking on it you will get a dialog:

Then follow the yellow triange and after clicking on it you'll get the dialog

+4
source

This is an AutoLayout constraints error. You will need to review your restrictions that are used in the XIB view. Correct these restrictions, and then your project will work fine. Hope this helps you.

0
source

Change the priority of the lower space to: supervisor or upper space for: supervisor from the default (1000) to high (750).

0
source

Source: https://habr.com/ru/post/1487840/


All Articles