Iavor
Iavor

Reputation: 2077

How to wrap a UILabel within a prototype cell

I have a Table View with the following Prototype Cell:

enter image description here

I want the text of the UILabel labeled "Description" to wrap onto a new line if the texts exceeds the UILabel's width.

The UILabel has the following Attributes:

enter image description here

However, it doesn't work...Any help is appreciated.

Upvotes: 1

Views: 122

Answers (2)

Moin Shirazi
Moin Shirazi

Reputation: 4425

There can be 2 issues in you auto layout constraints

If u have given fixed height to Description label then it can create problem

Secondly if u have given fixed height to image and bottom constraint to that image then also your label will not take the desired height

Please check this 2 constraint and let me know if u need any help

Upvotes: 0

Wes
Wes

Reputation: 1042

Adjust the bottom constraint on the label, it is causing the label to have a fixed height that is hiding any wrapped lines. Everything else is fine.

Upvotes: 1

Related Questions