Friday 15 April 2011

UIImageView Programmatically (Tutorial)





UIImageView Programmatically

      Now We are going to create UIImageView Programmatically Without using Interface builder.

In .h file 
-Declare this
IBOutlet UIImageView *image;

In .m file
UIImage *image1=[UIImage imageNamed:@name.jpg"];
image=[[UIImageview alloc]initWithImage:image1];
-set the view size for the image
image.frame=CGRectMake(0,0,320,400);
-Add the image to the view
[self.view addSubview:image];
-release the image
[image release];
To Add an event to this Image

No comments:

Post a Comment