8

I am following the Stanford lectures on developing apps for iOS and I've run into a bit of a problem. The lecturer says to click on a label from the Document Outline and then go to Editor > Size to fit contents in order to remove the fixed size constraints. However my problem is that "Size to fit contents" is disabled and I cannot click it (see image).

disabled size to fit contents

Any idea what I'm doing wrong?

1
  • 6
    click an empty area in your storyboard, then click the label again. That usually helps. Commented Aug 3, 2013 at 13:37

2 Answers 2

16

I fixed the issue by dragging around the labels and resizing them (randomly) manually and then the option was enabled!

Sign up to request clarification or add additional context in comments.

1 Comment

you can also clear all constraints to that label or any UIView with button Resolve Auto Layout IssuesClear Constraints in IB, in Xcode 5+.
13

OK this is one that has bugged me for a while. But I finally figured out that if you tap one of the corner handles of the label (you will briefly see a diagonal line mouse icon for resizing) then the "size to fit contents" option is re-enabled.

This also works for getting the "horizontal rule" and "vertical rule" options back if you tap on one of the corner handles of a view.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.