开发者

How do I set the picture in a UIImageView

开发者_运维问答I need to set an image view to display an image here.

else if (n == 2) {
    gamestatus.text = @"The Card is A Two.";
    // I Need to set my imageview to a picture here.
}


UIImageView *imageView = [[UIImageView alloc] initWithImage:myImageHere];

or if the imageView is already declared...

myImageView.image = myImageHere;

Edit: to answer the question about how to set to an image.

a simple way (some would argue its slightly inefficient),

myImageView.image = [UIImage imageNamed:@"my Example Image.png"];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜