Last Updated: February 25, 2016
·
494
· bolomichelin

Chapiter 9 : Golden Challenge

Set heigth

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
 CGFloat height = 0;

 if([indexPath row] < [[[BNRItemStore sharedStore] allItems] count]) {
 height = 60;
 } else {
 height = 44;
 }

 return height;
}

change font size

if([indexPath row] < [[[BNRItemStore sharedStore] allItems] count]) {
 [[cell textLabel] setText:@"No more items!"];
 }else{
 [[cell textLabel] setText:[p description]];
 cell.textLabel.font = [UIFont systemFontOfSize:20];

}

Add a background

- (void)viewDidLoad
{
 UIImage *image = [UIImage imageNamed:@"background.png"];
 UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
 self.tableView.backgroundView = imageView;
}