Re: Drawing issues in custom view
Re: Drawing issues in custom view
- Subject: Re: Drawing issues in custom view
- From: "Michael Ash" <email@hidden>
- Date: Thu, 10 Jul 2008 18:26:14 -0400
On Thu, Jul 10, 2008 at 12:30 PM, Jason Wiggins
<email@hidden> wrote:
> Not to worry, just realised what is happening. drawRect: gets called for ALL
> drawing operations in the view, not just background as I expected.
> Carry on...
This is not really true. What's happening is that your subviews are
updating and they are not fully opaque. So they need your view to draw
first before they can draw, so that they appear to be on top of your
contents as you desire.
The problem you're having is that the 'rect' parameter of the
-drawRect: method is not, in fact, the extent of your view. Rather
it's the 'dirty' rect, the area that needs updating. You should only
use this parameter to determine *what* to draw, never to determine
where. Use [self bounds] to find out the extent of your view.
For more information, see this page:
http://www.cocoadev.com/index.pl?DrawRect
Mike
_______________________________________________
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