开发者

reload existing UITableViewCell with different height and content

开发者 https://www.devze.com 2023-03-13 19:37 出处:网络
To reload cell height and content I have called: [[self tableView]reloadRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:0 inSection:kSectionShoppingList]] withRowAnimation:UITa

To reload cell height and content I have called:

[[self tableView]reloadRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:0 inSection:kSectionShoppingList]] withRowAnimation:UITab

This function calls the HeightForRow Data Source method, but it does not call CellForRowAtIndexPath data source method.

Is i开发者_如何学Got their default behavior or am I missing something?


Try reloadSectionAtIndexPath method.

UPDATE

You need to calculate height before you display cell. Like in heightForRowAtIndexPath.

Use this method to display variable height rows.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号