0
votes

enter image description hereI have got a view which I have attached as screen shot, I have got unwanted space at the bottom of the second UILabel, the content coming into that UILabel is from a web url JSON using Alamofire. I have set the lines to 0. I can understand why the space is there because its a label and does not fill the height of the bottom, but if I change the height to fit it, the texts gets truncated. So how do i avoid this extra space. I have added all relevant constraints. I am fairly new to Swift.

enter image description here

1
Do you have a UIImageView and 2 UILabel inside a UIScrollView? What should be the minimum height of the UIImageView? If possible can you please add what constraints you have tried? - Rikh
What are your settings for padding and margins on the UILabel? - matt.writes.code
I have added image of the constraints, but the height is dynamic depending on the JSON content feed - rob
Can you describe what layout you want to implement? How do you imagine no space at the bottom if those labels contain only one line of text each? - alexburtnik
@alexburtnik. I have set the lines to 0, so that the text would adapt to the content feed, like I said I am fairly new to swift, so If you know a better way let me know - rob

1 Answers

0
votes

I have solved it, I stretched the bottom labels height to fill the bottom and took off the height constraint. Also in the ViewController I added

    articleContentValue.sizeToFit()