• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[iPhone] CALayer/UIView ordering
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iPhone] CALayer/UIView ordering


  • Subject: [iPhone] CALayer/UIView ordering
  • From: PCWiz <email@hidden>
  • Date: Thu, 11 Feb 2010 17:54:00 -0700

In my UIViewController I create a CAGradientLayer in the viewDidLoad method:

CAGradientLayer *gradient = [CAGradientLayer layer];
	gradient.frame = CGRectMake(self.view.bounds.origin.x, self.view.bounds.origin.y + 44.0, self.view.bounds.size.width, self.view.bounds.size.height - 44.0);
	gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor colorWithRed:0.953 green:0.961 blue:0.965 alpha:1.00] CGColor], (id)[[UIColor colorWithRed:0.729 green:0.749 blue:0.792 alpha:1.00] CGColor], nil];
	[self.view.layer addSublayer:gradient];

The gradient works fine. Now this view has a subview (custom UIView subclass, added in Interface Builder) that draws a line. The problem is that the CAGradientLayer goes OVER the subview of the main view. If I comment out the code that creates the CAGradientLayer, I can see the contents of the subview just fine. Is there any way to make this CAGradientLayer go UNDER the subview?

Independent Cocoa Developer, Macatomy Software
http://macatomy.com


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [iPhone] CALayer/UIView ordering
      • From: David Duncan <email@hidden>
  • Prev by Date: Re: No Methods being called in my subclassed NSArrayController
  • Next by Date: Re: [iPhone] custom CALayer drawing
  • Previous by thread: Re: [iPhone] custom CALayer drawing
  • Next by thread: Re: [iPhone] CALayer/UIView ordering
  • Index(es):
    • Date
    • Thread