1.self.view = imageView;(如果支持触摸要加上imageView.userInteractionEnabled = YES;)
self.view.layer.contents = (id) image.CGImage;
比如设置一个BUTTON的background color可以这样写
UImage *image = [UIImage imageNamed:@"name.png"];
button.layer.contents = (id) image.CGImage;
ps,由于我这里每次旋转都要设置,所以采用了imageNamed方法,如果仅调用一次,可以使用imageWithContentsOfFile。