Update editing style of UITableViewCell depending on contents

后端 未结 2 735
花落未央
花落未央 2020-12-10 18:50

I am creating a table-based interface similar to iPad Contacts, in which the user can add to a list of rows by tapping a blank row at the bottom. The table is always in edi

相关标签:
2条回答
  • 2020-12-10 19:04

    Try calling reloadRowsAtIndexPaths:withRowAnimation: on the row being edited. (I'm not sure if that will mess up the first responder status on your text field or not.)

    0 讨论(0)
  • 2020-12-10 19:17

    I fought this same problem yesterday. You basically have to toggle the table view's editing mode property. After you do that, it will refresh your cell's editingStyle.

    Here's the code that does the trick for me:

    self.tableView.editing = NO;
    self.tableView.editing = YES;
    

    This gives what appears to me to be the exact same sort of effect as the contacts app. At a minimum, it will refresh your editingStyle.

    0 讨论(0)
提交回复
热议问题