Created
February 8, 2013 14:04
-
-
Save anonymous/4739194 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (id)initWithImage:(UIImage *)image | |
{ | |
self = [super init]; | |
if (self) { | |
[self setClipsToBounds:YES]; | |
[self setAutoresizesSubviews:YES]; | |
[self setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; | |
CGImageRef originalImage = [image CGImage]; | |
_image = image; | |
_image = [[UIImage alloc] initWithCGImage:originalImage scale:imageScale orientation:image.imageOrientation]; | |
_imageView = [[UIImageView alloc] initWithImage:_image]; | |
[_imageView setImage:_image]; | |
[_imageView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; | |
[self addSubview:_imageView]; | |
} | |
return self; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment