Advertisement
Guest User

Untitled

a guest
Aug 15th, 2012
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. Special Custom Checkmark in UITableViewCell
  2. #define CHECKBOX_TAG 123
  3.  
  4. UIView *customAccessoryView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 60, 30)] autorelease];
  5. UIImageView *otherInfo = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)] autorelease];
  6. UIImageView *checkbox = [[[UIImageView alloc] initWithFrame:CGRectMake(30, 0, 30, 30)] autorelease];
  7. checkbox.tag = CHECKBOX_TAG;
  8. [customAccessoryView addSubview:otherInfo];
  9. [customAccessoryView addSubview:checkbox];
  10. cell.accessoryView = customAccessoryView;
  11.  
  12. UIImageView *checkbox = [cell.accessoryView viewWithTag:CHECKBOX_TAG];
  13. if(selected){
  14. checkbox.hidden = NO;
  15. }else{
  16. checkbox.hidden = YES;
  17. }
  18.  
  19. @property(nonatomic) UITableViewCellAccessoryType accessoryType
  20.  
  21. @property(nonatomic, retain) UIView *accessoryView
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement