码迷,mamicode.com
首页 > 其他好文 > 详细

UITableView默认选中第一行

时间:2014-08-29 12:23:57      阅读:116      评论:0      收藏:0      [点我收藏+]

标签:blog   os   io   for   数据   div   cti   log   on   

//如果有数据,选中第一行
if(tableDataSource.count > 0)
    {
        NSIndexPath *indextPath = [NSIndexPath indexPathForRow:0 inSection:0];
        // 调用UItableViewDelegate
        [self tableView:self.selectDeptTable didSelectRowAtIndexPath:indextPath];
        // 选中第一行
        [self.tableView selectRowAtIndexPath:indextPath animated:YES scrollPosition:UITableViewScrollPositionNone];
    }

  

UITableView默认选中第一行

标签:blog   os   io   for   数据   div   cti   log   on   

原文地址:http://www.cnblogs.com/1oo1/p/3944406.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!