|
I want the rows in my tableview to scale dynamicly based upon the content (2 labels, total of 3 lines of text). I keep getting this error (and my cells are set to standard size):
I think I've cohered to all of the requirements: I fully constrain (top and bottom anchors) the labels in my custom cell:
I set the rows on the TableView to automic dimension:
And I even supply an estimated row heigth in the delagate method:
Where do I go wrong ? |
|
Self-sizing cells are tricky and there are lot of ways it can go wrong... Where are you calling Also you have duplicate constraints:
I would ditch manually setting frame for Table View as well as autoresizingMask mask and just use AutoLayout to pin it to all four edges. |
|
I also think this could be because of several problems. However, my strongest guess would be that you do not call You actually do not need to override the delegate methods, you can set the |
|
Damn you are right @LoadingIndicator! (nice nickname by the way). The famous TAMIC likely strikes again. |
|
I should have said that TAMIC is set to false in my subclass of label, which both labels are ... configureContents(0 is called from the init() Here's my whole custom cell class:
And the ProjectTitleLabel subclass:
|
|
That's weird. Could you try adding your labels as subViews to the contentView? Currently you just add it to the cell itself. Haha, thanks @nemecek-filip :D |
|
@LoadingIndicator Woei! That's a grave oversight of mine, gonna change that immediatly!
Also changed setup of the tableview to have an estimated rowheight set!
And the delegate methods are no longer needed! Both together did the trick! Thank you so much! Sharp eyes 🦅 |
|
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's all new Paywall Editor allow you to remotely configure your paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.