Trying to create a circular button with image, but the image wasn't clipped automatically
Trying to create a circular button with image, but the image wasn't clipped automatically
- Subject: Trying to create a circular button with image, but the image wasn't clipped automatically
- From: Aaron Lewis <email@hidden>
- Date: Sun, 08 Feb 2015 14:38:16 +0800
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
imageNamed:@"avatar.jpeg"] forState:UIControlStateNormal];
But the framework doesn't seem to "clip" the rectangular image into a
circular one.
All extra parts are displayed on screen.
Did I get this wrong? Am I expected to use only circular images?
--
Best Regards,
Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/
Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33
_______________________________________________
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