2012-06-25 37 views
2

我想在UITableView完成初始化后将单元格编号0设置为选定的单元格?在UITableView初始化中设置选定的单元格

我试图做的:

[cell setSelected:YES]; 

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 

但单元格颜色变成黑色。

回答

3

UITableView本身可以管理选择。尝试拨打电话:

- (void)selectRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UITableViewScrollPosition)scrollPosition 
相关问题