Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let gradinatLayer = CAGradientLayer()
- gradinatLayer.frame = self.collectionView.frame //self.currentViewController.view.frame
- let cgColors:[CGColorRef] = [UIColor.blackColor().colorWithAlphaComponent(0.7).CGColor, UIColor.clearColor().CGColor, UIColor.blackColor().colorWithAlphaComponent(0.7).CGColor]
- gradinatLayer.colors = cgColors
- gradinatLayer.startPoint = CGPointMake(0, 0.5)
- gradinatLayer.endPoint = CGPointMake(1.0, 0.5)
- gradinatLayer.locations = [0.15, 0.50, 0.85]
- self.collectionView.layer.insertSublayer(gradinatLayer, atIndex: 0)
- //This doesn't work
- self.collectionView.layer.shouldRasterize = true
- self.collectionView.layer.rasterizationScale = UIScreen.mainScreen().scale
Add Comment
Please, Sign In to add comment