-1
当我按下特定单元格按钮时,我在textView单元格中编辑了文本框和编辑按钮,显示光标和按钮图像已更改,并且我在此处调用了api。如果我再次单击按钮光标不显示在文本字段中。如何在tableview单元格文本框中显示光标
当我按下特定单元格按钮时,我在textView单元格中编辑了文本框和编辑按钮,显示光标和按钮图像已更改,并且我在此处调用了api。如果我再次单击按钮光标不显示在文本字段中。如何在tableview单元格文本框中显示光标
试试这个:将标签分配给IndexPath中行的单元格中的编辑按钮。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
cell.editButton.tag = indexpath.row;
}
获取参考到您的位置基于其indexpath。将其文本字段设置为第一个响应者。
- (IBAction)editButtonClicked:(id)sender{
UIButton *button = (UIButton*)sender;
NSIndexPath *indexPath = [NSIndexPath indexPathForItem:button.tag inSection:0];
CustomCell *cell = (CustomCell*)[tableView cellForRowAtIndexPath:indexPath];
[cell.yourTextField becomeFirstResponder];
}
我把textfield硬编码在表格单元格中[cell.yourTextField becomeFirstResponder];这个属性如何添加,我添加像这样,但不是确切的UIButton * button1 =(UIButton *)sender; NSIndexPath * indexPath1 = [NSIndexPath indexPathForItem:button1.tag inSection:0]; 的UITableViewCell *细胞=(的UITableViewCell *)[tableView_EditCategory的cellForRowAtIndexPath:indexPath1]; [cell.contentView addSubview:txtFld_EmailEditCategory]; [txtFld_EmailEditCategory becomeFirstResponder];在你的问题你的cellForRowAtIndexPath的 –
更新代码 –
你好,特定的细胞文本框光标快到了,我想只有一个按钮的图像将被突出显示,这里所有的按钮图像强调,只有在一次单一的按钮图像和光标将突出显示。 –