Re: Trying to create a circular button with image, but the image wasn't clipped automatically

2015-02-07 Thread Jonathan Hull
You need to set the layer’s -maskToBounds: property to YES to clip. Thanks, Jon > On Feb 7, 2015, at 10:38 PM, Aaron Lewis wrote: > > Hi, > > I'm trying to create a circular button, with an rectangular image: > >self.button.layer.borderColor = [UIColor blackColor].CGColor; >self.butt

Trying to create a circular button with image, but the image wasn't clipped automatically

2015-02-07 Thread Aaron Lewis
Hi, I'm trying to create a circular button, with an rectangular image: self.button.layer.borderColor = [UIColor blackColor].CGColor; self.button.layer.borderWidth = 5; self.button.layer.cornerRadius = self.button.bounds.size.width / 2.0; [self.button setBackgroundImage: [UIImage