UIImageView *imageview=[[UIImageView alloc]initWithFrame:CGRectMake(20, 20, 50, 50)];
imageview.backgroundColor=[UIColor blueColor];
[self.view addSubview:imageview];
UIImage *image=[UIImage imageNamed:@"图片名"];
imageview.image=image;
其中图片名如果是png图片则不用写扩展名,否则需要加上扩展名。