• 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
Adding a shadow to a UIImage in a UIImageview
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adding a shadow to a UIImage in a UIImageview


  • Subject: Adding a shadow to a UIImage in a UIImageview
  • From: Development <email@hidden>
  • Date: Sat, 19 Dec 2009 21:34:56 -0700

I have subclassed UIImageView and am trying to add a shadow to the image inside of it. However I'm not getting anything at all and I'm not sure what to do.

Below is the code I am using for this:

-(void)addShadow
{
	UIGraphicsBeginImageContext(self.frame.size);//If I don't add this line I get invalid context error.
	CGContextRef context = UIGraphicsGetCurrentContext();
	CGContextSetShadow(context, CGSizeMake(.5,.5),.2);
	[self setNeedsDisplay];
}_______________________________________________

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: Adding a shadow to a UIImage in a UIImageview
      • From: Development <email@hidden>
  • Prev by Date: NSExpressionForFunction - only works with NSSQLiteStoreType?
  • Next by Date: Re: NSOutlineView Bad Scrolling Behavior (Solved))
  • Previous by thread: NSExpressionForFunction - only works with NSSQLiteStoreType?
  • Next by thread: Re: Adding a shadow to a UIImage in a UIImageview
  • Index(es):
    • Date
    • Thread