Skip to content

Instantly share code, notes, and snippets.

@0oneo
Created November 18, 2013 16:04
Show Gist options
  • Save 0oneo/7530314 to your computer and use it in GitHub Desktop.
Save 0oneo/7530314 to your computer and use it in GitHub Desktop.
set background of a view, see link
UIImage *image = [UIImage imageNamed:@"name.png"];
view.layer.contents = (id) image.CGImage;
// 如果需要背景透明加上下面这句
view.layer.backgroundColor = [UIColor clearColor].CGColor;
@0oneo
Copy link
Author

0oneo commented Nov 18, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment