2012-04-05 114 views
0

当我向上和向下滚动tableview时,我得到的tableview单元格没有被选中。我应该如何在代码中使用以下方法?iPhone中的tableview单元格选择

[tableview selectRowAtIndexPath:animated:scrollPosition]; 
+0

有U试图此消息中 - (空)的tableView:(UITableView的*) tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath ???把一些代码..! – 2012-04-05 09:46:27

回答

1

我该如何在代码中使用下面的方法?

[tableview selectRowAtIndexPath:animated:scrollPosition]; 

:添加一个新的细胞上的tableview和滚动表达增加细胞补充说:

NSArray *indexPaths = [NSArray arrayWithObjects: [NSIndexPath indexPathForRow:[self.yourDataSource count]-1 inSection:0],nil]; 
[self.myTableView beginUpdates]; 
[self.myTableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationTop]; 
[self.myTableView endUpdates]; 
[self.myTableView scrollToRowAtIndexPath:indexPaths atScrollPosition:UITableViewScrollPositionTop animated:YES]; 
相关问题