Re: Undocumented Leopard support for overlapping sibling views
Re: Undocumented Leopard support for overlapping sibling views
- Subject: Re: Undocumented Leopard support for overlapping sibling views
- From: Ricky Sharp <email@hidden>
- Date: Thu, 28 Aug 2008 15:48:09 -0500
On Aug 28, 2008, at 3:28 PM, Nathan Vander Wilt wrote:
According to two list postings (http://lists.apple.com/archives/cocoa-dev/2007/Nov/msg01760.html
, http://lists.apple.com/archives/cocoa-dev/2007/Nov/msg01764.html)
both by Apple employees, overlapping sibling subviews are fully
supported in Leopard (and presumably beyond).
However, the official documentation (http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaViewsGuide/WorkingWithAViewHierarchy/chapter_5_section_5.html
) still says:
"Cocoa does not enforce clipping among sibling views or guarantee
correct invalidation and drawing behavior when sibling views
overlap. If you want a view to be drawn in front of another view,
you should make the front view a subview (or descendant) of the rear
view."
And Interface Builder 3.1 on the one hand has options like "Layout >
Send to Front" that change the ordering of subviews, yet on the
other still warns about "Illegal geometry" when a view overlaps one
of its siblings even when the deployment target is set to 10.5.
I can't find anything in the documentation (or even release notes)
that describes that/how overlapping views are supported. Why isn't
this documented? Can we rely on overlapping sibling views working
now and in the future? Are there any caveats we should be aware of?
I believe that Apple relaxed the rules to allow CoreAnimation layers
to work correctly. Whether or non a non-layered UI fully supports
overlapping sibling views, I do not know.
I just tried a test in IB. Warnings show up on overlapping views
whether or not views are marked as needing a CA layer. I believe that
is a bug.
For the apps I'm writing, I do not yet use layers. For all views, I
never overlap them (using the subview approach instead).
Once I introduce layers, I will allow those particular views to
overlap. The rest of the UI will continue to not overlap.
One final thing to consider is that you may also suffer some
performance hits when things overlap; especially for custom views
where you do all the drawing. If your drawRect, e.g., always draws
everything regardless of what is actually dirty, you would then redraw
that whole thing if an overlapped view is marked dirty. Even if they
only overlap by a single pixel/point.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.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