Display Images in iPhone using UIImageView
Here is the code that will display the image using UIImageView in Objective-C.
CGRect imgRect = CGRectMake(0.0f, 0.0f, 320.0f, 109.0f);
UIImageView *image = [[UIImageView alloc] initWithFrame:imgRect];
[image setImage:[UIImage imageNamed:@"SampleImage.png"]]; // where SampleImage.png should be available within in the project
[self.view addSubview:image];
[image release];
CGRect imgRect = CGRectMake(0.0f, 0.0f, 320.0f, 109.0f);
UIImageView *image = [[UIImageView alloc] initWithFrame:imgRect];
[image setImage:[UIImage imageNamed:@"SampleImage.png"]]; // where SampleImage.png should be available within in the project
[self.view addSubview:image];
[image release];
Comments
Post a Comment