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];
68x68
通常の状態でpngを使用するカスタムボタンを作成しています。しかし、画像は変形しているように見えます。本来は円であるはずですが、楕円として表示されます。なぜそれが起こっているのか、ヒントや提案はありますか? 不思議なことに、別の円形の png と交換しようとしましたが220x220
、すべてが期待どおりに機能します。