Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. UIEdgeInsets contentInsets = UIEdgeInsetsMake(10, 0, 0, 0);
  2. CGRect shadowPath = UIEdgeInsetsInsetRect(self.dealMainContentView.bounds, contentInsets);
  3. self.dealMainContentView.layer.shadowPath = [UIBezierPath bezierPathWithRect:shadowPath].CGPath;
  4. self.dealMainContentView.layer.shadowColor = [[UIColor blackColor] CGColor];
  5. self.dealMainContentView.layer.shadowOffset = CGSizeMake(0.0f,0.0f);
  6. self.dealMainContentView.layer.shadowOpacity = 0.4f;
  7. self.dealMainContentView.layer.masksToBounds=NO;
  8.  
  9. UIEdgeInsets contentInsets = UIEdgeInsetsMake(-10, -10, 0, 0);
  10.  
  11. CGRect viewFrame=self.dealMainContentView.frame;
  12.  
  13. viewFrame.origin.x= viewFrame.origin.x+5; // 5 distance from left
  14. viewFrame.origin.y= viewFrame.origin.y-15;
  15. viewFrame.size.width=viewFrame.size.width-1o; // 5 distance from Right
  16. viewFrame.size.height=viewFrame.size.height-20;
  17.  
  18. CGRect shadowPathExcludingTop = UIEdgeInsetsInsetRect(viewFrame, contentInsets);
  19.  
  20. self.dealMainContentView.layer.shadowPath = [UIBezierPath bezierPathWithRect:shadowPathExcludingTop].CGPath;
  21. self.dealMainContentView.layer.shadowColor = [[UIColor blackColor] CGColor];
  22. self.dealMainContentView.layer.shadowOffset = CGSizeMake(0.0,0.0f);
  23. self.dealMainContentView.layer.shadowOpacity = 0.3f;
  24. self.dealMainContentView.layer.masksToBounds=NO;
  25.  
  26. UIEdgeInsets contentInsets = UIEdgeInsetsMake(-10, 10, 10, 10);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement