Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 自定义表格单元格背景图像_Iphone_Objective C_Ios_Uitableview_Three20 - Fatal编程技术网

Iphone 自定义表格单元格背景图像

Iphone 自定义表格单元格背景图像,iphone,objective-c,ios,uitableview,three20,Iphone,Objective C,Ios,Uitableview,Three20,我第一次尝试了three20 iPhone框架,但我似乎不知道如何将表格单元格的背景更改为UIImage,而不仅仅是颜色。有人能帮我吗?您可以使用如下图像模式设置单元格的内容视图的背景色: cell.contentView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image.png"]]; 如果单元格是UITableViewCell或three20TTTableViewCell派生单元格(因为

我第一次尝试了three20 iPhone框架,但我似乎不知道如何将表格单元格的背景更改为UIImage,而不仅仅是颜色。有人能帮我吗?

您可以使用如下图像模式设置单元格的
内容视图的
背景色

cell.contentView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image.png"]];

如果单元格是
UITableViewCell
或three20
TTTableViewCell
派生单元格(因为它们派生自
UITableViewCell

,这将起作用,但在应用程序中使用此模式时会产生内存问题。有时还会使应用程序崩溃。@Jasmine我不太清楚你说的PatternImage最大值是什么意思。上面推荐的方法是标准的iOS调用,如果出现崩溃或内存问题,可能是其他代码。然而,使用仪器进行的调查应该会有一些启示。如果它真的是一个错误,那么请提交给苹果。如果您对我的答案或方法有新问题,请以新问题的形式提交。谢谢