Created
January 16, 2011 11:42
-
-
Save shsteven/781715 to your computer and use it in GitHub Desktop.
Making the background cool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIView *view = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 100)] autorelease]; | |
CAGradientLayer *gradient = [CAGradientLayer layer]; | |
gradient.frame = view.bounds; | |
gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor blackColor] CGColor], (id)[[UIColor whiteColor] CGColor], nil]; | |
[view.layer insertSublayer:gradient atIndex:0]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment