UITableView一出现就滚动到底部(类似微信,qq聊天界面)

时间:2018-08-29 14:36:48   收藏:0   阅读:292

重写tableView所在控制器的 viewDidLayoutSubviews 方法,在此方法里面做滚动操作。

-(void)viewDidLayoutSubviews{

    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:9 inSection:0];

    [self.customsTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:NO];

}

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!