首页 前端 ios 正文

ios开发 tableView

long 2020-08-12 03:24 ios 人气495

设置一组一共显示几行

(NSInteger)tableView:(UITableView *)tableView

numberOfRowsInSection:(NSInteger)section


设置行高

(CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath


设置每行如何显示 

(UITableViewCell *)tableView:(UITableView *)tableView

         cellForRowAtIndexPath:(NSIndexPath *)indexPath


设置点击事件

(void)tableView:(UITableView *)tableView

didSelectRowAtIndexPath:(NSIndexPath *)indexPath


刷新整个tableView

[tableView reloadData]


局部刷新

[tableView reloadRowsAtIndexPaths]


滚动到某个位置

[tableView scrolToRowAtIndexPath]