• 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
Re: Static text over an image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Static text over an image
      • From: Rob Keniger <email@hidden>
    • Re: Static text over an image
      • From: Andre Masse <email@hidden>
References: 
 >Static text over an image (From: Andre Masse <email@hidden>)

  • Prev by Date: Re: When does Cocoa get "No more!" from malloc?
  • Next by Date: coredata: building tree from Entities
  • Previous by thread: Re: Static text over an image
  • Next by thread: Re: Static text over an image
  • Index(es):
    • Date
    • Thread