[英]tableview cell selection in iPhone
当我向上和向下滚动表格视图时,我得到的表格视图单元格未被选中。 我应该如何在代码中使用以下方法?
[tableview selectRowAtIndexPath:animated:scrollPosition];
我应该如何在代码中使用以下方法?
[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];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.