I'm using this code, in the simulator I get a cell with a big red button (the same size as the cell) with the title Delete Ingredient. I can click and the event is fired. Perfect.
In the device, an iPhone 3G, I get the cell with the button with a white background, no picture, nothing red ...
why ????
:-)
thanks,
r.
cell.accessoryType = UITableViewCellAccessoryNone;
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setBackgroundImage: [[UIImage imageNamed: @"redButton.png"] stretchableImageWithLeftCapWidth:7.0 topCapHeight:0.0] forState:UIControlStateNormal];
[button setTitle:@"Delete Ingredient" forState:UIControlStateNormal];
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
button.frame= CGRectMake(0.0, 0.0, 300, 44);
[cell.contentView addSubview:button];
[button addTarget:self action:@selector(ingredientDeleteAsk) forControlEvents:UIControlEventTouchUpInside];