UITableViewController背景图片

You*_*nzr 9 iphone xcode objective-c xcode4 xcode4.2

如何设置图像UITableViewController

我使用了很多东西,但它没有帮助我将图像设置为背景

UIImageView* bgView = [[[UIImageView alloc] initWithImage:
[UIImage imageNamed:@"Default.png"]] autorelease];

[tableView.backgroundView addSubview:bgView];
Run Code Online (Sandbox Code Playgroud)

还有这个

[[self view] setAutoresizesSubviews:NO];

UIView *backgroundView = [[UIView alloc] initWithFrame:self.view.frame];
backgroundView.backgroundColor = 
  [UIColor colorWithPatternImage:
    [UIImage imageNamed:@"Default.png"]];

self.tableView.backgroundView = backgroundView;
self.tableView.backgroundColor = [UIColor clearColor];

[backgroundView release];
Run Code Online (Sandbox Code Playgroud)

self.navigationController.view.backgroundColor = 
  [UIColor colorWithPatternImage:
    [UIImage imageNamed:@"myImage.png"]];
self.tableView.backgroundColor = [UIColor clearColor];
Run Code Online (Sandbox Code Playgroud)

这些都不适合我.

Whi*_*ger 25

设置background填充模式

[youTable setBackgroundView:
  [[UIImageView alloc] initWithImage:
    [UIImage imageNamed:@"bg.png"]]];
Run Code Online (Sandbox Code Playgroud)

设置background模式磁贴

[youTable setBackgroundColor:
  [UIColor colorWithPatternImage:
    [UIImage imageNamed:@"bg.png"]]];
Run Code Online (Sandbox Code Playgroud)