tags:

views:

149

answers:

1

I have problem displaying images.... It works perfectly on simulator but on iphone device it doesn't work.... here is the code for it...

Please Help -

UIView *shareView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 95)];
 shareView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bgImage.png"]];


 UIButton *button1 = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 64, 95)];
 UIImage *icon1 = [UIImage imageNamed:@"icon1.png"];
 [button1 setImage:icon1 forState:UIControlStateNormal];
 [button1 addTarget:self action:@selector(sendEmail) forControlEvents:UIControlEventTouchDown];
 [shareView addSubview:button1];

 UIButton *button2 = [[UIButton alloc] initWithFrame:CGRectMake(64, 0, 64, 95)];
 UIImage *icon2 = [UIImage imageNamed:@"icon2.png"];
 [button2 setImage:icon2 forState:UIControlStateNormal];
 [shareView addSubview:button2];

 UIButton *button3 = [[UIButton alloc] initWithFrame:CGRectMake(128, 0, 64, 95)];
 UIImage *icon3 = [UIImage imageNamed:@"icon3.png"];
 [button3 setImage:icon3 forState:UIControlStateNormal];
 [shareView addSubview:button3];

 UIButton *button4 = [[UIButton alloc] initWithFrame:CGRectMake(192, 0, 64, 95)];
 UIImage *icon4 = [UIImage imageNamed:@"icon4.png"];
 [button4 setImage:icon4 forState:UIControlStateNormal];
 [shareView addSubview:button4];

 UIButton *button5 = [[UIButton alloc] initWithFrame:CGRectMake(256, 0, 64, 95)];
 UIImage *icon5 = [UIImage imageNamed:@"icon5.png"];
 [button5 setImage:icon5 forState:UIControlStateNormal];
 [shareView addSubview:button5];


 [shareCell.contentView addSubview:shareView];
A: 

Did the .app folder (that you install on iphone device through iTunes) contains all the images? In my application i faced the same issue, since, images that i want to display are not present in the .app folder.

Pravara
My issue is resolved. I simply copied all the image files to the .app folder. and again build the application.
Pravara