customBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[customBtn setFrame:CGRectMake(200,200,68,68)];
UIImage *btnImage = [UIImage imageNamed:@"dash_pulsante_attivo"];
[customBtn setImage:btnImage forState:UIControlStateNormal];
[customBtn addTarget:self action:@selector(triggerMeasurement) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:customBtn];
I'm building a custom button that should be using a 68x68
png for it's normal state.
But the image looks deformed: it should be a circle, but it display as an oval.
Any hint or suggestion why it is happening? Curiously, I've tried to swap with another circular png, 220x220
, and everything works as expected.