(UITableView)背景图案图像问题

时间:2012-05-09 22:31:42

标签: objective-c cocoa-touch uitableview background-image

有两段代码:

代码1:

UIView* _backView = [[[UIView alloc] initWithFrame:[[self view] frame]] autorelease];
[_backView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"testbg"]]];
[[self tableViewCountrySelector] setBackgroundView:_backView];

代码2:

UIView* _backView = [[[UIView alloc] initWithFrame:[[self view] frame]] autorelease];
[[self tableViewCountrySelector] setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"testbg"]]];
[[self tableViewCountrySelector] setBackgroundView:_backView];

我的问题是:

  1. 为什么上面的代码输出相同的结果?代码应该解决UITableView背景的模式图像问题。
  2. 我只是不明白代码2是如何工作的。

0 个答案:

没有答案
相关问题