add button to uitableviewcell and did not showed up
I am adding a delete button to uitableviewcell at cellforrowatindexpath
but the button did not show up.
double deleteYOffset=10;
double deleteW=100;
double deleteH=100;
UIButton *deleteButton =[UIButton buttonWithType:UIButtonTypeCustom];
deleteButton.frame=CGRectMake(imageXoffset, deleteYOffset, deleteW,
deleteH);
UIImage *image = [UIImage imageNamed:@"Delete.png"];
[deleteButton setBackgroundColor:[UIColor greenColor]];
[deleteButton setImage:image forState:UIControlStateNormal];
[[cell contentView ]addSubview:deleteButton];
No comments:
Post a Comment