Created
May 4, 2013 19:27
-
-
Save oliverbarreto/5518465 to your computer and use it in GitHub Desktop.
Objective-C: Create UIImageView
This file contains 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
//First Create a Image & FrameRECT | |
UIImage *someImage = [UIImage imageNamed:@"a.png"]; | |
someRECT = CGRectMake(0, 0, weight, height); | |
//Method A | |
UIImageView *imageView = [[UIImageView alloc] initWithFrame:someRECT; | |
[self.view addSubview:imageView]; | |
//Method B | |
UIImageView *imageView = [[UIImageView alloc] initWithImage:someImage]; | |
imageView.frame = CGRectMake(0, 0, width, height); //If want resize of the original size of the image, set the size of your UIImageView |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment