J'utilise DTGridView avec une sous-classe de DTGridViewCell avec UILabel et UITextField pour effectuer une modification de cellule sur place. Cette idée a fonctionné pour moi dans UITableView comme ceci:DTGridView n'interagit pas avec UILabel
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
EditableDetailCell *cell = (EditableDetailCell *)[tableView cellForRowAtIndexPath:indexPath];
[[cell textField] setFrame:CGRectMake(8, 0, cell.frame.size.width, cell.frame.size.height)];
[[cell textField] becomeFirstResponder];
[[cell mylabel] setText: nil];
}
Le texte disparaît et le champ de texte apparaît. La même chose ne fonctionne pas pour moi avec
- (void)gridView:(DTGridView *)agridView selectionMadeAtRow:(NSInteger)rowIndex
column:(NSInteger)columnIndex
{
cell textField] setFrame:CGRectMake(8, 0, cell.frame.size.width, cell.frame.size.height)];
[[cell textField] becomeFirstResponder];
[[cell label] setText: nil];
}
Quelqu'un peut-il m'aider s'il vous plaît? Merci beaucoup.