CALayer z-ordering
CALayer z-ordering
- Subject: CALayer z-ordering
- From: Ivy Feraco <email@hidden>
- Date: Wed, 16 Sep 2009 11:42:32 -0400
Hi
I think am experiencing problems with CALayer z-ordering.
When I resize a superview, all its regular subviews become hidden/
obstructed (which is what I want), while the subviews with CALayer
remain drawn on top of the superview.
I have experimented with both layer-backed and layer-hosting to see if
that would solve my problem, as well as setting z-order.
I have a view (progressView) in a nib that gets loaded and added as a
subview to a superview.
In the nib, progressView has an NSProgressIndicator.
In my code, I create a layer (aViewLayer) in progressView with
CALayer * aViewLayer = [CALayer layer];
[[self view] setLayer:aViewLayer];
[[self view] setWantsLayer:YES];
Then I create two other sublayers (iconSublayer and textSublayer) and
add them as sublayers to aViewLayer, and position them around the
progress indicator.
iconSublayer gets content from setContent, while textSublayer uses the
delegate method drawLayer:inContext:
I think this is a pretty normal setup, but I don't know why the views
(progressViews) with CALayers get drawn on top despite the fact that
they are sublayers of a subview.
Shouldn't they be placed on a lower z-order since they are down
further in the hierarchy?
Any ideas?
Ivy Feraco
_______________________________________________
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