> But, the question still does remain, even if purely for academic
> reasons - can we clear a UIView (in a custom UITableViewCell) in the
> drawRect routine after beginning to draw in it. I have tried playing around
> with two options so far
> 1. CGContextClearRect() - This however clears to a black box and I am not
> able to get it to clear transparently. Setting isOpaque:NO on the view in
> the nib doesn't seem to have an effect.
> 2. Fill with white and then draw. This displays ok when then view is not
> selected. When it is selected, however, it results in blue color surrouding
> the view (with the view remaining white). Filling with blueColor in the
> selected state, doesn't seem to work well either. The blue color is a solid
> blue, while the selection blue surrounding it seems to be some sort of
> gradient

Views are hierarchically stuctured and draw "on top of each other" in the same 
context.
So if your drawRect is executed, there usually is already something in the 
context and you can not know what that is.
To "reset" back to the state when your drawRect has started, you may have 
success by taking a snapshot of the context at the beginning and draw that 
later again into the context.

Things are probably very different with layer-backed views.

Regards,
Mani
--
http://mani.de - friendly software
@manide
iVolume - listen to music hands-free
LittleSecrets - the encrypted notepad
Sahara - sand in your pocket
Watchdog - baffle the curious

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to