Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Diary App Using Core Data Custom UITableViewCell Custom UITableViewCell with Dynamic Height

Eric M
Eric M
2,242 Points

Can't get height of UITableView Cell to be respected. I have watched build-a-diary-app>custom-uitableviewcell twice.

I have autolayout off. I reverified all the options. I log out the height that is calculated by THEntryCell heightForEntry. This all looks correct.

The body text extends outside the range of the table cell. and the table cell itself does not grow in height.

Maybe this has to do with new versions of iOS, but I'm not equipped to tell.

Eric M
Eric M
2,242 Points

Another person with the same issue: https://teamtreehouse.com/forum/how-do-i-get-the-body-text-to-adjust-to-the-container makes me think it is iOS version related. Not sure what the solution is.

Eric M
Eric M
2,242 Points

It sort-of works if I do an autolayout solution as suggested in this link: http://www.appcoda.com/self-sizing-cells/

But this has nothing to do with the height calculation method Ash uses (I turned it off). That method should still work, I think a checkbox is just missing somewhere.

3 Answers

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

I think all you need to do is allow more lines for the text in the attributes inspector ( I think that's the one it's in).

are u already solve this problem by that ? are that gonna work ? where exactly we need add more line ?

Eric M
Eric M
2,242 Points

I don't think so. For auto-line height detection, 0 is the correct number of lines. I think springs/struts doesn't work the way the video indicates, and I'm not sure how it works now.

I have it working with autolayout but want to understand the springs/struts way to do this.

is that no other choice for this problem ? , i can't get the right height like in the video . really need help