views:

330

answers:

3

Hello!

This is driving me nuts.

I have a TableView with custom cells. My cell contains a editble textview. Is it possible to change rowheight on cell and textview dynamicly (when I editing the textView) ?

best regards

A: 

The row height is calculated from either the delegate or the table view's property. I think the height is determined when the cell comes into view.

One possible avenue is to use - (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation.

Is the cell with with the text view unique in the table? You may run into problems if the user is in the middle of editing and the cell needs to be re-layed out and the text view is not unique.

Giao
the textview is not unique in the table.
f0rz
A: 

Hope this link helps you.

All the best.

Warrior
A: 

You can't change the height of a tableview cell without reloading the table. This means that every time a new line is needed in the textview, the tableview needs to reload.

While this can be done (with much manual tweaking,) I don't think the results will make for a good interface. Instead, you should have the cell open a detail view and let the user type there. This is how all the Apple apps handle the same problem and it is the solution most users will expect.

It will also save you a heck of a lot time and frustration.

TechZen