Reputation: 164
I have a problem with the UIButtons. How can I scale a image to fit their frame?
Upvotes: 1
Views: 1816
Reputation: 7613
UIButton *Btn = [UIButton buttonWithType:UIButtonTypeCustom];
Btn.frame = //set frame using CGRectMake(x,y,width,height);
[Btn setBackgroundImage:[UIImage imageNamed:@"image name here"] forState:UIControlStateNormal];
Upvotes: 2