使UISegmentedControl的段分隔符变暗

时间:2010-11-23 11:10:49

标签: ios uisegmentedcontrol

我有一个分段控件,它有三个按钮,我想要将分隔线条的线条变暗。

我的代码是:

NSArray *listArray = [NSArray arrayWithObjects:@"Email",@"SMS",nil];
UISegmentedController *segmentedController = [[UISegmentedControl alloc] initWithItems:listArray]; 
segmentedController.segmentedControlStyle = UISegmentedControlStyleBar;//i have to use this style(bar) 
segmentedController.momentary = YES; 
segmentedController.frame = CGRectMake (90, CGRectGetMaxY(lbl.frame)+50, 140, 40); 
//seg.tintColor = [UIColor redColor]; 
[segmentedController addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged]; 
[self.view addSubview:segmentedController];

1 个答案:

答案 0 :(得分:0)

将样式切换为纹理圆角:

原创(圆形): alt text

纹理圆形: alt text