I am creating a custom uiview that contains an uilabel and an uiimage assigned to an uiimageview. I assign the custom uiview to the uitableview headerview but i only see the uilabel not the uiimage…please help this is my code…
UIView *containerView1 =[[UIView alloc]initWithFrame:CGRectMake(0, 0, 300, 30)];
UILabel *headerLabel1 =[[UILabel alloc]initWithFrame:CGRectMake(75, 4, 300, 20)];
headerLabel1.userInteractionEnabled = YES;
headerLabel1.text = [NSString stringWithFormat:@"- Latest update %@ -", now];
headerLabel1.textColor = [UIColor brownColor];
headerLabel1.shadowOffset = CGSizeMake(0, 1);
headerLabel1.font = [UIFont boldSystemFontOfSize:13];
headerLabel1.backgroundColor = [UIColor clearColor];
UIImage *image = [UIImage imageNamed:@"line_seperator.png"];
UIImageView *imageView = [ [ UIImageView alloc ] initWithFrame:CGRectMake(0.0, 0.0, 30, 30)];
imageView.image = image;
imageView.contentMode = UIViewContentModeScaleAspectFit;
[containerView1 addSubview:headerLabel1];
[containerView1 addSubview:imageView];
[containerView1 addSubview:indicator2];
walltable.tableHeaderView = containerView1;
Any help appreciated.
Forgot to say that this code executes after the uitableview loads.
I have found it. The image was not right. The image was downloaded from the web as .gif . I opened it in photoshop and saved it as .png but it did not saved correctly. I created a new image in photoshop and copy the one i had in that new image. I saved it as .png and it worked.