美文网首页
ios设置tableview默认选中某行并实现点击某行的效果

ios设置tableview默认选中某行并实现点击某行的效果

作者: 爱iOS的延哥 | 来源:发表于2016-11-04 11:39 被阅读1915次

tableView加载出来默认选中某一行:(默认第一行)

//设置选中第一行(默认有蓝色背景)

[self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:0] animated:YES scrollPosition:UITableViewScrollPositionTop];

---------------------------------分割线----------------------------------

tableView加载出来后默认点击某一行:(默认第一行)

//实现点击第一行所调用的方法

[self tableView:self.tableView didSelectRowAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:0]];

相关文章

网友评论

      本文标题:ios设置tableview默认选中某行并实现点击某行的效果

      本文链接:https://www.haomeiwen.com/subject/jjaiuttx.html