Home Tutorial Iphone Examples UIIMageView Add Image

 
 

Share on Google+Share on Google+
UIIMageView Add Image
Posted on: September 22, 2010 at 12:00 AM
Advertisement
initWithImage is a image declaring method that is used to declare the image while while creating a UIImageView.

UIIMageView Add Image

"initWithImage" is a image declaring method that is used to declare the image while while creating a UIImageView.

Syntax of initWithImage method
- (id)initWithImage:(UIImage *)image;

a simple example

//declare the Image
UIImage *one = [UIImage imageNamed:@"myImage.png"];
//creating a UIImageView
UIImageView *imageView1 = [[[UIImageView alloc] initWithImage:one] autorelease];

//to add image on view
[self.view addSubview:imageView1];

You can write and run the above given lines of code into the "ViewDidLoad" method.

Advertisement

Related Tags for UIIMageView Add Image:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: September 22, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com