UI若要放置底圖進入專案,
可先把底圖檔案複製近專案後加入以下程式碼:
self.view.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"image.png"]];
或者以下這段:
UIGraphicsBeginImageContext(self.view.frame.size);
[[UIImage imageNamed:@"image.png"] drawInRect:self.view.bounds];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
self.view.backgroundColor = [UIColor colorWithPatternImage:image];
文章標籤
全站熱搜
留言列表