0
我想为UITableViewController设置背景图像。我已经得到了下面的代码,它可以将背景设置得很好,但图像本身被拉伸到通常尺寸的两倍左右。UITableViewController背景图像拉伸
[[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];
图片是只有640x960像素。
我试过手动设置backgroundView
的框架,但它不会改变背景图像的大小。
任何人都可以解释我要去哪里错了吗?
非常感谢。
这工作很好! UIImageView管理完美地检测图像尺寸。并感谢关于这两个图像的提示:) – 2011-04-07 22:48:08