【iOS】UIViewに背景画像を設定する方法
UIColorにcolorWithPatternImageというメソッドがあるので、背景画像を渡して対象となるviewのbackgroundColorにセットするだけ。
UIImage *backgroundImage = [UIImage imageNamed:@"bg.png"]; self.view.backgroundColor = [UIColor colorWithPatternImage:backgroundImage];
試してみると、こんな感じです。
背景画像なのに、UIColorっていうところが若干気持ち悪いです。