iPhone固定位置的UITableView背景 [英] iPhone Fixed-Position UITableView Background
问题描述
我要建一个iPhone应用程序,而无需使用界面生成器的。我已经设置了分组的UITableView在以下庄园背景:
I'm building an iPhone app without the use of Interface Builder. I have set the background of a grouped UITableView in the following manor:
self.view.backgroundColor = [的UIColor colorWithPatternImage:[UIImage的imageNamed:@groupedBackground.png]];
我试图解决这一问题的背景图像,使其不与表格单元格滚动。有谁知道如何做到这一点?
I'm trying to fix this background image so that it doesn't scroll with the table cells. Does anyone know how to do this?
推荐答案
我们发现,它的工作原理完全一样,你要问,如果不是使用的backgroundColor,分配给backgroundView,像这样:
We find that it works exactly as you ask, if instead of using backgroundColor, you assign to backgroundView, like so:
self.tableView.backgroundView = [[UIImageView alloc] initWithImage:
[UIImage imageNamed:@"background.png"]];
表格单元格,然后滚动的背景,它是静止的顶部。 (这一直以来的SDK 3.2版本,我相信。)
The table cells then scroll on top of the background, which is stationary. (This has been available since version 3.2 of the SDK, I believe.)
这篇关于iPhone固定位置的UITableView背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!