2010-12-02 50 views
1

这是我的用于创建细胞代码问题的在iPhone表视图


cell.textLabel.text = [的ListData objectAtIndex:indexPath.row];
如果(indexPath.row == 1)
cell.detailTextLabel.text = @ “某些文本”;
return cell;


这里有共20行,只有8行是可见的同时

我的问题是,详细文本标签是在重复多行,当我做滚动....

请帮助

回答

4

试试这个:

cell.textLabel.text = [listdata objectAtIndex:indexPath.row]; 
if (indexPath.row == 1) 
    cell.detailTextLabel.text = @"Some text"; 
else 
    cell.detailTextLabel.text = @""; 
return cell; 

表细胞再生,让你^ h每次都重置一切。

+0

+1 thanks ...... – Saawan 2010-12-02 05:10:06