• 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: Clipping subview drawing to arbitrary path or image (iPhone)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clipping subview drawing to arbitrary path or image (iPhone)


  • Subject: Re: Clipping subview drawing to arbitrary path or image (iPhone)
  • From: David Duncan <email@hidden>
  • Date: Fri, 15 Jan 2010 16:16:15 -0800

On Jan 15, 2010, at 4:10 PM, Rick Mann wrote:

>> If not, this could be done (with performance penalty) using the layer's mask property. Simplest way I can think is to make a new layer, assign the contents of the parent layer to that new layer's contents, then assign that layer as the mask of all subviews. This may require a bit of futzing around to get right however.
>
> The subviews will consist of a UIScrollView and a set of UIButtons. Generally, I'd like to avoid subclassing them, if possible. I'm implementing a control with behaviors very similar to a horizontal UIPickerView. Unfortunately, it lives in a non-rectangular shape, and the surrounding elements are transparent and should NOT show the control underneath.


I don't see any reason why the mask property wouldn't work for that, as log as the performance is acceptable to you (I believe using a mask will cause an offscreen render to occur). That said, if you can possibly invert this (that is, invert the mask and draw the content *above* the others) you should have better performance.

That and I think I spoke a little fast on the exact usage of the mask – iirc, you should only need to apply it to a common parent and it should affect all children as well.
--
David Duncan
Apple DTS Animation and Printing

_______________________________________________

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: Clipping subview drawing to arbitrary path or image (iPhone)
      • From: Rick Mann <email@hidden>
References: 
 >Clipping subview drawing to arbitrary path or image (iPhone) (From: Rick Mann <email@hidden>)
 >Re: Clipping subview drawing to arbitrary path or image (iPhone) (From: David Duncan <email@hidden>)
 >Re: Clipping subview drawing to arbitrary path or image (iPhone) (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Clipping subview drawing to arbitrary path or image (iPhone)
  • Next by Date: Re: Out of memory, or some other problem?
  • Previous by thread: Re: Clipping subview drawing to arbitrary path or image (iPhone)
  • Next by thread: Re: Clipping subview drawing to arbitrary path or image (iPhone)
  • Index(es):
    • Date
    • Thread