iPhone - Setting background on UITableViewController

后端 未结 6 1535
借酒劲吻你
借酒劲吻你 2020-12-04 10:50

Is there any way to set a background view on a UITableViewController?

I try with the code I am using on a UIViewController, but the view comes over all

6条回答
  •  情深已故
    2020-12-04 11:36

    Actually, I got it working! :)

    NSString *backgroundPath = [[NSBundle mainBundle] pathForResource:@"background" ofType:@"jpg"];
    UIImage *backgroundImage = [UIImage imageWithContentsOfFile:backgroundPath];
    UIColor *backgroundColor = [[UIColor alloc] initWithPatternImage:backgroundImage];
    self.tableView.backgroundColor = backgroundColor; 
    [backgroundColor release];
    

提交回复
热议问题