Do not resize UIRoundendImageView actually because on rotation everything is broken

This commit is contained in:
Gautier Pelloux-Prayer 2015-01-16 08:47:23 +01:00
parent ab7c448a60
commit 57a9179a30

View file

@ -31,14 +31,14 @@
// warning: for non-squared image, this function will generate an ellipsoidal image, not a round image!
- (void)setRoundRadius:(BOOL)radius {
CALayer *imageLayer = self.layer;
CGFloat height = frame.size.height;
CGFloat width = frame.size.width;
CGFloat roundRadius = height > width ? width / 2 : height / 2;
CALayer *imageLayer = self.layer;
CGFloat height = imageLayer.frame.size.height;
CGFloat width = imageLayer.frame.size.width;
CGFloat roundRadius = height > width ? width / 2 : height / 2;
[imageLayer setCornerRadius:roundRadius];
[imageLayer setBorderWidth:0];
[imageLayer setMasksToBounds:YES];
[imageLayer setCornerRadius:roundRadius];
[imageLayer setBorderWidth:0];
[imageLayer setMasksToBounds:YES];
}