I have the following code.
UIImage *cancelImg = [UIImage imageNamed:@"cancel.jpeg"]; UIButton *btnCancel = [UIButton buttonWithType:UIButtonTypeCustom]; btnCancel.userInteractionEnabled = YES; [btnCancel setFrame:CGRectMake(0.0,0.0, 28.0, 28.0)]; [btnCancel setImage:cancelImg forState:UIControlStateNormal]; cell.accessoryView = btnCancel;
cancel.jpeg is currently larger than 28 x 28, and in fact 100 x 100.
Why does the button display an image size of 100 x 100 when I set the UIButton size to 28 x 28?
iphone uibutton
Joo park
source share