背景图像shell看起来像这样:
*注意在细胞下消失的白色圆圈!
我的代码如下:
在vIEwDIDLoad中我设置了表视图的背景图像:
self.tableVIEw.backgroundcolor = [UIcolor colorWithPatternImage:[UIImage imagenamed:@"general_bg.png"]];
对于每个单元格我删除任何背景颜色,如下所示:
UIVIEw *bckVIEw = [[[UIVIEw alloc] initWithFrame:CGRectZero] autorelease];bckVIEw.backgroundcolor = [UIcolor clearcolor];cell.backgroundVIEw = bckVIEw;cell.backgoundcolor = [UIcolor clearcolor];cell.contentVIEw.backgroundcolor = [UIcolor clearcolor];UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectMake(x,y,x1,y1)];textLabel.backgroundcolor = [UIcolor clearcolor];[cell.contentVIEw addSubvIEw:textLabel];
>行分隔符是添加到单元格的自定义图像.
解决方法 不要设置tablevIEw的Backgroundcolor属性,而是尝试设置backgroundvIEw:UIVIEw *background = [[UIVIEw alloc] initWithFrame:self.tableVIEw.bounds];background.backgroundcolor = [UIcolor colorWithPatternImage:[UIImage imagenamed:@"YOUR_IMAGE.png"]];self.tableVIEw.backgroundVIEw = background;
这应该可以解决单元格与背景拍摄相同图像的问题.
总结以上是内存溢出为你收集整理的iphone – UITableView单元格采用UITableView背景图像的图案颜色全部内容,希望文章能够帮你解决iphone – UITableView单元格采用UITableView背景图像的图案颜色所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)