views:

18

answers:

1

Hi, everyone,

I want to ask a question about the UIview on the iPhone applicaiton. I want to display a image one the UIView programmatically, but I don't know how to do it. What should I do to display the image. Thank you very much.

A: 

You should use UIImageView. It is a subclass of UIView and you can set the image with an instance on UIImage.

Here is an example to add it to another UIView.

UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"nameofimage.png"]];
[myUIView addSubview:imageView];
Conceited Code
@Conceited Code, thank you very much.
Questions