UITableView背景现在滚动细胞?

ing*_*ham 2 uitableview ios

我注意到了一些事情:我有一个带有自定义背景的UITableViewController,设置方式如下:

UIImage *backgroundImage = [UIImage imageNamed:@"background.png"];
self.view.backgroundColor = [UIColor colorWithPatternImage:backgroundImage];
Run Code Online (Sandbox Code Playgroud)

在iPhone模拟器4.1上,背景显示正确,固定且永不移动......但是当我使用iPhone模拟器4.2或4.3时,背景是滚动细胞!我想这是Apple在iOS 4.2上做出的改变,但是如何避免这种情况呢?

Gor*_*ght 6

将tableView的backgroundView设置为UIImageView会导致图像保持固定位置.

UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"background"]];
self.tableView.backgroundView = backgroundImageView;
[backgroundImageView release];
Run Code Online (Sandbox Code Playgroud)