Display Images

Submitted by:Jhon Jhon

Date added:16 August, 2011

Category:iPhone

Display an image anywhere on the screen, without using UI Builder. You can use this for other types of views as well.

Tags: display images

Code Snippet:

CGRect myImageRect = CGRectMake(0.0f, 0.0f, 320.0f, 109.0f); UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect]; [myImage setImage:[UIImage imageNamed:@"myImage.png"]]; myImage.opaque = YES; // explicitly opaque for performance [self.view addSubview:myImage]; [myImage release]; 
 
 

Comments