UITextView that expands to text using auto layout

前端 未结 16 2041
面向向阳花
面向向阳花 2020-11-28 01:25

I have a view that is laid out completely using auto layout programmatically. I have a UITextView in the middle of the view with items above and below it. Everything works f

16条回答
  •  温柔的废话
    2020-11-28 01:43

    Here's a solution for people who prefer to do it all by auto layout:

    In Size Inspector:

    1. Set content compression resistance priority vertical to 1000.

    2. Lower the priority of constraint height by click "Edit" in Constraints. Just make it less than 1000.

    In Attributes Inspector:

    1. Uncheck "Scrolling Enabled"

提交回复
热议问题