私のアプリケーションでは、UIView に背景画像を設定したいと考えています。シミュレータ iOS では、このコードは機能します。そしてiPhoneの黒い背景に。コードは次のとおりです。
- (void)viewDidLoad
{
[super viewDidLoad];
UIGraphicsBeginImageContext(self.view.frame.size);
[[UIImage imageNamed:@"appBG.png"] drawInRect:self.view.bounds];
UIImage *appbg = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
self.view.backgroundColor = [UIColor colorWithPatternImage:appbg];
}
更新:私は自分の問題を決めました