以编程方式在表格单元格中添加UISegmentedControl,背景清晰

时间:2011-03-20 19:04:31

标签: iphone uisegmentedcontrol grouped-table

我已将表格视图分组。我想在具有清晰背景的表格单元格中添加UISegmentedControl,以便它显示为FOOTER。我怎样才能做到这一点?我尝试使用clearColor。但它不起作用。

1 个答案:

答案 0 :(得分:1)

使用明确的UIView对象设置背景视图,如下所示:

UIView *clearView = [[UIView alloc] initWithFrame:CGRectZero];
[clearView setBackgroundColor:[UIColor clearColor]];
[self setBackgroundView:clearView];
[clearView release];

并确保将单元格选择样式设置为无。

编辑:添加了一些方括号