Hi,
I seem to be having a really strange problem. As you can see in the code below, I have an image view that is supposed to show up in the background of a UITableView when the view controller's view is loaded. For some reason, whether the background image view creation code is placed in viewDidLoad or viewDidAppear, the background image won't show until after I tap one of the table view's cells.
Here's the code:
Please help, and thank you!
I seem to be having a really strange problem. As you can see in the code below, I have an image view that is supposed to show up in the background of a UITableView when the view controller's view is loaded. For some reason, whether the background image view creation code is placed in viewDidLoad or viewDidAppear, the background image won't show until after I tap one of the table view's cells.
Here's the code:
Code:
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *roadImagePath = [[NSBundle mainBundle] pathForResource:@"Word Family App Screen Blank Road" ofType:@"png"];
CGRect tableViewFrame = [self.tableView frame];
CGRect roadViewFrame = (CGRect){CGPointZero,tableViewFrame.size};
roadViewFrame.size.height = 300;
UIImage *image = [UIImage imageWithContentsOfFile:roadImagePath];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
[imageView setFrame:roadViewFrame];
[imageView setUserInteractionEnabled:false];
[self.tableView setBackgroundView:imageView];
Please help, and thank you!