IOS 给View 设置背景;UIView background

2017-04-14  本文已影响747人  PengPengPro
UIGraphicsBeginImageContext(self.view.frame.size);
[[UIImage imageNamed:@"image.png"] drawInRect:self.view.bounds];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

self.view.backgroundColor = [UIColor colorWithPatternImage:image];
上一篇下一篇

猜你喜欢

热点阅读