मेरे पास निम्न कोड है।UIButton की कस्टम छवि और फ्रेम
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 वर्तमान में 28 से x 28 बड़ा है और यह वास्तव में है 100 x 100
क्यों बटन प्रदर्शन छवि जब मैं 28 के लिए UIButton के आकार निर्धारित किया है की 100 x 100 आकार एक्स 28?
मुझे छवि को 28 x 28 तक आकार बदलना पड़ा। मैंने सोचा कि UIButton का फ्रेम 100 x 100 छवि को 28 x 28 पर क्रैक करेगा। मान लीजिए। –