-5

谁能给我提供在uitableview中加载自定义单元格的教程。我在我的应用程序中需要这个。请帮助我。

4

2 回答 2

0

试试下面的代码

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

    static NSString *CellIdentifier = @"MyCellIdentifier";



    SPHTableCell *cell = (SPHTableCell *)[data_Table dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[SPHTableCell alloc] initWithStyle:UITableViewCellStyleDefault
                                                reuseIdentifier:CellIdentifier];
    }

    return cell;
}
于 2012-12-28T11:45:21.600 回答
0

示例教程可能会有所帮助。其中一种方法是扩展 UITableViewCell 类并为您的自定义单元格使用自定义 .XIB。嗯,这是一般的想法。

于 2012-12-28T11:24:45.727 回答