现在的位置: 首页 > 综合 > 正文

UITableView 默认选择某行的方法

2017年11月30日 ⁄ 综合 ⁄ 共 285字 ⁄ 字号 评论关闭

    //默认选中行,放在 reloadData 后
    NSIndexPath *ip=[NSIndexPath indexPathForRow:0 inSection:2];
    [tableView selectRowAtIndexPath:ip animated:YES scrollPosition:UITableViewScrollPositionBottom];
    NSIndexPath *path=[NSIndexPath indexPathForItem:0 inSection:2];
    [self tableView:tableView didSelectRowAtIndexPath:path];

抱歉!评论已关闭.