Hi All
I have a grouped style UITableViewController which I am managing in code.
I have created a method to set the background of the UITableViewController which creates an image view, adds it and then sends it to the back.
The only place i can get it to work correctly is by invoking the method in
for the UITableViewController. Everything looks spot on, background image with controls on top (contained in cells with transparent backgrounds). The only problem is that the image isn't visible immediately on load of the view, you see the view first with default background and then the image applied.
I've tried invoking in
and
but the cells containing controls are not visible, all i can see is the image.
Here's the method:
Code:
- (void)setBackgroundImage {
self.view.backgroundColor = [UIColor clearColor];
UIImage *backgroundImage = [UIImage imageWithContentsOfFile:
[[NSBundle mainBundle]
pathForResource:@"logo320x460"
ofType:@"png"]];
UIImageView *backgroundView = [[UIImageView alloc]
initWithImage:backgroundImage];
backgroundView.frame = CGRectMake(0, 0, 320, 460);
[self.view addSubview:backgroundView];
[self.view sendSubviewToBack:backgroundView];
[backgroundView release];
}
Is there a more appropriate place to call my setBackgroundImage method? Or a better solution than this?
Thank you in advance
Hanks