Editing a UITextField inside a UITableViewCell fails

前端 未结 7 1749
时光取名叫无心
时光取名叫无心 2020-12-04 11:24

In my application I have a UITextField inside a UITableViewCell. If I click inside the text field and add some text I find that if try to move the

相关标签:
7条回答
  • 2020-12-04 12:22

    actually what works best seems to be to set the table "editing" property to true in "viewDidLoad" and adding these to the table delegate

    - (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath
    {
        return NO;
    }
    
    - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
    {
        return NO;
    }
    

    you don't need to do anything in the text field delegate

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