Created
March 19, 2015 14:29
-
-
Save saiday/2242182fc01fc1be62be to your computer and use it in GitHub Desktop.
TableView with soften edges
This file contains hidden or 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
| CAGradientLayer *maskLayer = [CAGradientLayer layer]; | |
| CGColorRef outerColor = [UIColor colorWithWhite:1.0 alpha:0.0].CGColor; | |
| CGColorRef innerColor = [UIColor colorWithWhite:1.0 alpha:1.0].CGColor; | |
| maskLayer.colors = @[(__bridge id)outerColor, (__bridge id)innerColor]; | |
| maskLayer.locations = @[@0, @.05]; | |
| maskLayer.bounds = self.tableView.bounds; | |
| maskLayer.anchorPoint = CGPointZero; | |
| maskLayer.position = CGPointMake(0, -self.tableView.contentInset.top); | |
| self.tableView.layer.mask = maskLayer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment