Hello everybody. I am new to programming and I have the problem that in the Xcode when I want to put constraints on objects, I press on the constraints button, it appears disabled, and I don't know why. Please help .. if I don't put the constraints the objects don't adapt to the device. Thank you !!
constraints disabled
I press on the constraints button, it appears disabled
Which button ? Add new constraints ?
It appears or it IS disabled ?
Do you mean nothing occurs when you click on the 'Add new Constraints' button ? Or what occurs ?
Are you sure you have effectively selected an object ?
What type of constraint do you want to add ?
If it is a constraint relative to Safe area or to another object relative position, control drag from the object to Safe Area or to the other object is the best way to do it.
Good morning. Thanks in advance.
I thought I had added a photo to my question, but I see no. In this photo, perhaps my doubt can be seen better.
I have a label in a view.
When I want to add constraint to this object, I click on the Add new constraint button (bottom right of the screen). I am supposed to like 4 fields in which I can put the distance of the object both at the top, bottom, left and right. Well, those fields and all others are deactivated, so I can't put any value, and I can't do anything with them. That is my problem, that I cannot put any constraint of this label nor of a second label that I have in the view.
Thais is probably because the label is not selected in the canvas.
Anotehr way to add constraints is to control-drag from the label (in the obbect list or directly in canvas) to the containing view or to safe area.
Then in the hud view that appears, select top, bottom, leading, trailing.
You will see the constraints appear in the size Inspector. And can modify constraints there.
Did you solve your problem ?
If no, what is still pending ?
If yes, thanks to close this thread.
Good Morning. I feel the delay in responding. I don't know what the canvas is, when you say .. "Thais is probably because the label is not selected in the canvas". I am new to programming and I don't understand canvas.
The canvas is the drawing area of Interface builder.
thank yo u!!!!! it's works !!!!