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;
}
Written by Bolo Michelin
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#The big nerd ranch
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#