Guest User

Untitled

a guest
Oct 16th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  2.  
  3. static NSString *CellIdentifier = @"Cell";
  4.  
  5. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  6. if (cell == nil) {
  7. cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
  8. }
  9.  
  10. // Configure the cell.
  11.  
  12. CGRect contentRect = CGRectMake(8.0, 50.0, 280, 150);
  13. UILabel *textView = [[UILabel alloc] initWithFrame:contentRect];
  14.  
  15. textView.text = @"Type whatever you want to here. It will appear right below the last cell.";
  16. textView.numberOfLines = 6;
  17. textView.textAlignment = UITextAlignmentCenter;
  18. textView.textColor = [UIColor grayColor];
  19. textView.backgroundColor = [UIColor clearColor];
  20. textView.font = [UIFont systemFontOfSize:16];
  21. [cell.contentView addSubview:textView];
  22. [textView release];
  23.  
  24. [[cell textLabel] setText:@"Type in the cell text here. Can be as long as you want and it will be centered."];
  25. [[cell textLabel] setNumberOfLines:2];
  26. [[cell textLabel] setTextAlignment:UITextAlignmentCenter];
  27.  
  28. // If you want a photo below the last cell put it here.
  29. UIImageView *img = [[UIImageView alloc]initWithFrame:CGRectMake(95, 185, 130, 195)];
  30. [img setImage:[UIImage imageNamed:@"Photo.png"]];
  31. [cell addSubview:img];
  32. [img release];
  33.  
  34. cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
  35.  
  36. return cell;
  37.  
  38. }
Add Comment
Please, Sign In to add comment