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

问题描述 投票:2回答:1

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

iphone uisegmentedcontrol grouped-table
1个回答
1
投票

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

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

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

编辑:添加一些方括号

© www.soinside.com 2019 - 2024. All rights reserved.