Hello I have a trouble customizing a background of the grouped table view..
Here’s the code I used
UIView *backgroundView = [[UIView alloc] initWithFrame: window.frame];
backgroundView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"TableViewBackground.png"]];
[window addSubview:backgroundView];
[backgroundView release];
yourTableViewController = [[ATableViewController alloc] initWithStyle:UITableViewStyleGrouped];
yourTableViewController.view.backgroundColor = [UIColor clearColor];
[window addSubview:yourTableViewController.view];
[window makeKeyAndVisible];
Thank you 🙂
+added)
I modified the codes but still not working..
These codes are in delegate.m, didFinishLaunchingWithOptions method
tableViewController = [[UITableViewController alloc] initWithStyle:UITableViewStyleGrouped];
UIView *backgroundView = [[UIView alloc] initWithFrame: window.frame];
backgroundView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"TableViewBackground.png"]];
tableViewController.tableView.backgroundView = backgroundView;
[window addSubview:backgroundView];
[backgroundView release];
tableViewController = [[UITableViewController alloc] initWithStyle:UITableViewStyleGrouped];
tableViewController.tableView.backgroundColor = [UIColor clearColor];
[window addSubview:tableViewController.tableView];
[window makeKeyAndVisible];
and in delegate.h tableviewcontroller is declared.. not sure about this part tho..
@interface BetaVersionAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
UINavigationController *navigationController;
UIViewController *viewController;
UITableViewController *tableViewController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
@property (nonatomic, retain) IBOutlet UITableViewController *tableViewController;
Thanx:)
You should set the backgroundView property of your table: