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];
No comments:
Post a Comment