选中tableView的indexPath.row这一行
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.isFromChatView)
self.chatViewController.phraseString = [self.phraseArray objectAtIndex:indexPath.row];
//else
//self.newSMSViewController.messageString = [self.phraseArray objectAtIndex:indexPath.row];
//去掉选中的背景,恢复原来的样子
[tableView deselectRowAtIndexPath:indexPath animated:YES];
[self dismissModalViewControllerAnimated:YES];
}
前提是选中一行,做如下操作:
去掉[tableView deselectRowAtIndexPath:indexPath animated:YES],效果如下:
加上 [tableView deselectRowAtIndexPath:indexPath animated:YES],效果如下:
时间: 2024-10-12 22:26:43