code_junkie

Is there a proper way to handle overlapping NSView siblings

Nov 13th, 2011
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. yy = [CALayer layer];
  2. yy.frame = CGRectMake(300,300, 300,300);
  3.  
  4. rear = [CALayer layer];
  5. rear.backgroundColor = CGColorCreateGenericRGB( 0.75, 0.75, 0.75, 1.0 );
  6.  
  7. [yourOnlyNsView setLayer:rear]; // these two lines must be in this order
  8. [yourOnlyNsView setWantsLayer:YES]; // these two lines must be in this order
  9.  
  10. [rear addSublayer:rr];
  11. [rear addSublayer:yy];
  12. [yy addSublayer:s1];
  13. [yy addSublayer:s2];
  14. [yy addSublayer:s3];
  15. [yy addSublayer:s4];
  16. [rear addSublayer:tt];
  17. [rear addSublayer:ff];
  18.  
  19. -(void) shuff
  20. {
  21. [CATransaction begin];
  22. [CATransaction setValue:[NSNumber numberWithFloat:0.0f]
  23. forKey:kCATransactionAnimationDuration];
  24. if ..
  25. [rear insertSublayer:ff below:yy];
  26. else
  27. [rear insertSublayer:ff above:yy];
  28. [CATransaction commit];
  29. }
Add Comment
Please, Sign In to add comment