UItableView一些小方法
分类: UITableView和UIScrollView 2014-09-05 09:17 2894人阅读 评论 (1) 收藏 举报 目录 (?) [+] 1、UItableView设置偏移量 通过设置tableView的偏移量,让列表默认滚动到某个位置,内涵段子里面的效果 [objc] view plain copy [myTableView setContentOffset:CGPointMake( 0, 1 0 0) animated: YES]; 2、刷新某行cell的方法 有时候只需要刷新某行的cell的数据,完全没必要调用[tableView reloadData]刷新整个列表的数据,调用以下方法即可。。 [objc] view plain copy NSIndexPath *indexPath_ 1=[NSIndexPath indexPathForRow: 1 inSection: 0]; NSArray *indexArray=[NSArray arrayWithObject:indexPath_ 1]; [myTableView reloadRowsAtIndexPaths:indexArray withRowAnimation:UITableViewRowAnimationAutomatic]; 3、改变分组列表之间的间距 方法一 [objc] view