Problem in Rendering images in UIImageView in iPhone programming.

Posted by suse on Stack Overflow See other posts from Stack Overflow or by suse
Published on 2010-04-30T08:08:19Z Indexed on 2010/04/30 8:27 UTC
Read the original article Hit count: 209

Filed under:
|
|
|

Hello,

I've a UIViewController and a UIImageView, on UIImageView i want to flip between 2 images, which i'm not able to achieve.

This is the code i've written, plz correct me if i'm wrong.

UIViewController* VC = [[UIViewController alloc]init];
VC.view.backgroundColor = [UIColor redColor];
UIImageView* imgView = [[UIImageView alloc]initWithFrame:CGRectMake(0,0,320,400)];
[imgView setImage:[UIImage imageNamed:@"Image_A.jpg"]];
[VC.view addSubview:imgView];

sleep(2);

[imgView setImage:[UIImage imageNamed:@"Image_B.jpg"]];
[VC.view addSubview:imgView];

[window addSubview:VC.view];

so when i execute this project, only Image_B is displayed on screen, while i want Image_A to be displayed then on sleep(2), Image_B has to be displayed.

How would i make it possible?? plz guide me..

I'm struggling with this problem since 3days .. plz try to help me out...

Thank You.

© Stack Overflow or respective owner

Related posts about image

Related posts about rendering