ボタンの外観を2つの画像で変更したい.1つは通常の状態、もう1つは選択時に強調表示/選択された状態ですが、方法がわかりません。これを試しました:
UIImage *buttonImage_Home = [UIImage imageNamed:@"upload.png"];
UIImage *stretchableButtonImageNormal = [buttonImage_Home stretchableImageWithLeftCapWidth:12 topCapHeight:0];
UIButton *homeButton = (UIButton *)[self.view viewWithTag:2];
[homeButton setBackgroundImage:stretchableButtonImageNormal forState:UIControlStateNormal];
それは機能しますが、押された/タッチされた場合に2番目の画像を追加する方法がわかりません。助けてください