设置颜色表中我知道如何设置颜色为纯表。 如果切换到组合表格,背景颜色也会移动并位于表格本身之外的背景中。 也可以设置颜色到表格。即一种颜色用于外部区域,另一种用于桌面?是否有可能在分组表
回答
这可以通过添加几行代码来完成。
对于使用图像作为背景,
tableView.opaque = NO;
[tableView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"image.png"]]];
对于使用单一颜色,您可以使用,
tableView.opaque = NO;
[tableView setBackgroundColor:[UIColor blueColor]];
更多详细信息,你可以看一下this tutorial。
真是太爽了,谢谢。 – 2012-02-02 09:35:38
将图片设置为背景时,就像两张图片。一个就像一个完整的背景,相同的图像就像我的分组桌子周围的框架,跟随着scoll,但另一个背景是固定的。结果是带有图片的框架在相同的图片背景下滑动,看起来有点奇怪。如果框架不在那里,那将是完美的。你碰巧知道如何解决这个问题? – 2012-02-03 12:18:23
对于使用
[myTableView setBackgroundColor: [UIColor redColor]];
和内彩,可以设置将电池在UITableView的数据源的方法的背景颜色外的颜色可以通过界面生成器或通过代码设置表背景色:
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString * CellIdentifier = @"customCell";
UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
cell.backgroundColor = [UIColor greenColor];
return cell;
}
谢谢,效果很好! – 2012-02-02 09:35:14
谢谢!如果您投票回答我的答案并将其选为接受答案,我将不胜感激。这将有助于我们建立声誉。 – 2012-02-02 10:14:06
现在我将你的答案标记为一个有用的答案。你是这个意思吗?? – 2012-02-02 11:48:51
- 1. 是否有可能检索SQL结果分组为列表
- 2. 是否有可能在BigQuery中使分区表非分区?
- 3. WPF Datagrid,是否有可能混合组和纯(非分组)行?
- 4. 是否有可能进行分页智能表
- 5. 是否有可能在Magento
- 6. 是否有可能在Symfony3
- 7. 是否有可能在Javascript
- 8. 是否有可能在Android
- 9. 是否有可能在.NET
- 10. 是否有可能在GSA
- 11. 是否有可能在widget.TextInputLayout
- 12. 是否有可能在iOS
- 13. 是否有可能在Ext.grid.column.Action
- 14. 是否有可能在android
- 15. 是否有可能在iPhone
- 16. 是否有可能在python
- 17. 是否有可能在Java
- 18. 是否有可能在WPF
- 19. 是否有可能在CMD.EXE
- 20. 是否有可能在
- 21. 是否有可能在android
- 22. 是否有可能在IDA
- 23. 是否有可能在GLSL
- 24. 是否有可能在android
- 25. 是否有可能在XSLT
- 26. 是否有可能在iPhone
- 27. 是否有可能在PhantomJS
- 28. 是否有可能在HAPIJS
- 29. 是否有可能改变.NET数组的分配方法?
- 30. 是否有可能知道查询组件的各个分数?
看看这个以前SO质疑http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view – visakh7 2012-02-02 08:17:56