Guest User

Untitled

a guest
Apr 30th, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. let gradinatLayer = CAGradientLayer()
  2. gradinatLayer.frame = self.collectionView.frame //self.currentViewController.view.frame
  3.  
  4. let cgColors:[CGColorRef] = [UIColor.blackColor().colorWithAlphaComponent(0.7).CGColor, UIColor.clearColor().CGColor, UIColor.blackColor().colorWithAlphaComponent(0.7).CGColor]
  5.  
  6. gradinatLayer.colors = cgColors
  7. gradinatLayer.startPoint = CGPointMake(0, 0.5)
  8. gradinatLayer.endPoint = CGPointMake(1.0, 0.5)
  9. gradinatLayer.locations = [0.15, 0.50, 0.85]
  10.  
  11. self.collectionView.layer.insertSublayer(gradinatLayer, atIndex: 0)
  12.  
  13. //This doesn't work
  14. self.collectionView.layer.shouldRasterize = true
  15. self.collectionView.layer.rasterizationScale = UIScreen.mainScreen().scale
Add Comment
Please, Sign In to add comment