UIButtonの背景色を変えるのに、一々画像作るの面倒だな〜と思ってたら、UIButtonに背景色を設定する | 404 odakoh Not Foundで、「プログラム内で画像作っちゃおう」って感じでやっていたので、自分用にアレンジしてみました。 元ネタ ・UIColor指定で背景色画像作成 変更点 ・カテゴリ使ってUIButtonを拡張 ・色指定を@"RRGGBB"にしたIFを追加 で、以下がその実装です。 // UIButton+BGColor.h @interface UIButton (BGColor) - (void)setBackgroundColor:(UIColor *)color forState:(UIControlState)state; - (void)setBackgroundColorString:(NSString *)colorStr forState: