Created
December 5, 2013 06:48
-
-
Save adow/7801157 to your computer and use it in GitHub Desktop.
mask layer
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
_maskLayer=[[CAGradientLayer layer]retain]; | |
_maskLayer.frame=self.bounds; | |
_maskLayer.colors=@[(id)[UIColor colorWithRed:255/255.0f green:255.0f/255.0f blue:255/255.0f alpha:1.0f].CGColor, | |
(id)[UIColor colorWithRed:255/255.0f green:255.0f/255.0f blue:255/255.0f alpha:0.0f].CGColor]; | |
_maskLayer.startPoint=CGPointMake(0.5, 0.3f); | |
_maskLayer.endPoint=CGPointMake(0.5f, 1.0f); | |
_maskLayer.locations=@[@0.0f,@1.0f]; | |
self.layer.mask=_maskLayer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment