Created
April 21, 2014 08:27
-
-
Save victorchee/11136166 to your computer and use it in GitHub Desktop.
iOS线性渐变视图
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
AGradientLayer *gradientLayer = [CAGradientLayer layer]; | |
gradientLayer.frame = self.view.frame; | |
gradientLayer.colors = [NSArray arrayWithObjects:(id)baseColor.CGColor, (id)barColor.CGColor, nil]; | |
[self.view.layer insertSublayer:gradientLayer atIndex:0]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment