• 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
Discard all drawing in a UIView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Discard all drawing in a UIView


  • Subject: Discard all drawing in a UIView
  • From: Malayil George <email@hidden>
  • Date: Wed, 21 Jul 2010 23:14:21 -0400

Hi,
   I am trying to draw to a custom UITableViewCell. The UITableViewCell has
a UIView and I do some custom drawing in it's drawRect. However, in some
cases while doing the drawing I run into an exception. I catch the exception
and at this point, want to clear all existing drawing in the view and start
again. My approach so far has been

backgroundColor = [UIColor clearColor];
//Custom draw code in try block

//If exception
backgroundColor = [UIColor whiteColor];
CGContextFillRect(context, rect); //context is current graphics context and
rect is bounds of the UIView
//Different draw code below

While this works, it messes up selecting the cell. On selecting the cell,
the view remains white, with it's surrounding blue. In cells without the
exception, selecting it renders the whole cell blue (which is what I would
like).

Is there anyway to discard all drawing in the cell without resorting to
filling it with white or some other color?


Thanks
George
_______________________________________________

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: Discard all drawing in a UIView
      • From: Steve Christensen <email@hidden>
  • Prev by Date: Re: How to force NSMenu to redraw its menu items?
  • Next by Date: Re: How to force NSMenu to redraw its menu items?
  • Previous by thread: UIImage Color Overlay
  • Next by thread: Re: Discard all drawing in a UIView
  • Index(es):
    • Date
    • Thread