Re: Static text over an image
Re: Static text over an image
- Subject: Re: Static text over an image
- From: "Shawn Erickson" <email@hidden>
- Date: Thu, 30 Oct 2008 08:26:54 -0700
On Wed, Oct 29, 2008 at 9:48 PM, Andre Masse <email@hidden> wrote:
> Hi,
>
> I want to have text over an image. Even though I set it up in IB (move image
> to the back, bring the label to the front), the label is always drawn behind
> the image. Is there a setting to be set in IB for that or do I have to draw
> the text myself?
<http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/CocoaViewsGuide/WorkingWithAViewHierarchy/chapter_5_section_5.html>
"Note: For performance reasons, 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."
In fact IB and ibtool warns about this when you compile a XIB.
If you are using layer backed views I think this restriction goes away
since layers have a more formal Z ordering requirement. I am not sure
if restricting to 10.5 alone is enough to deal with this (don't think
it is).
You normally deal with this by nesting views... your text view would
be a subview of the image view or by doing custom rendering.
-Shawn
_______________________________________________
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