Intrinsic Content Size
You put a custom view you built (say, a tag chip view) into a UIStackView and it's sized to zero and invisible. How would you explain the cause and the fix in terms of intrinsic content size?
You put a custom view you built (say, a tag chip view) into a UIStackView and it's sized to zero and invisible. How would you explain the cause and the fix in terms of intrinsic content size?
A custom view doesn't tell Auto Layout its own size by default, so without size constraints it's computed as zero. Override intrinsicContentSize to return the content plus padding, and call invalidateIntrinsicContentSize() when the content changes so the engine reads the value again.
UIKitShort answerIntro
How is an Auto Layout constraint represented internally, as a formula?
#autolayout
UIKitMultiple choiceBasics
You've placed titleLabel and dateLabel side by side on one row with Auto Layout. When the…
#autolayout
UIKitMultiple choiceIntro
Which of the following statements about the Safe Area are correct? Pick all that apply.
#autolayout
UIKitMultiple choiceIntro
When would it be appropriate to use leftAnchor instead of leadingAnchor in an Auto Layout…
#autolayout