标签:
1. UITableView
- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section { view.tintColor = [UIColor clearColor]; }- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section { UITableViewHeaderFooterView *footer = (UITableViewHeaderFooterView *)view; [footer.textLabel setTextColor:[UIColor whiteColor]]; }- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{    UITableViewCell *cell;    switch (indexPath.row) {        case 0:        {            cell =[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CELL1];            cell.backgroundColor = [UIColor yellowColor];            cell.selectionStyle = UITableViewCellSelectionStyleDefault;        }            break;        case 1:        {            cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CELL2];            cell.backgroundColor = [UIColor redColor];            cell.selectionStyle = UITableViewCellSelectionStyleGray;        }            break;        case 2:        {            cell =[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CELL2];            cell.backgroundColor = [UIColor blueColor];            cell.selectionStyle = UITableViewCellSelectionStyleBlue;        }            break;        case 3:        {            cell =[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CELL4];            cell.backgroundColor = [UIColor purpleColor];            cell.selectionStyle = UITableViewCellSelectionStyleDefault;        }            break;    }    cell.imageView.image = [UIImage imageNamed:@"warning_btn"];    cell.detailTextLabel.text = @"detailTextLabel";    cell.textLabel.text = @"textLabel";    return cell;}标签:
原文地址:http://www.cnblogs.com/ljmaque/p/UITableView.html