_segment = [[UISegmentedControl alloc] initWithItems:@[@"aaaa", @"bbbb"]];
[_segment setFrame:CGRectMake(20, 300, 280, 30)];
[_segment setTintColor:[UIColor grayColor]];
[_segment setSelectedSegmentIndex:0];
_segment.layer.masksToBounds = YES;
_segment.layer.cornerRadius = 10.0;
_segment.layer.borderWidth = 1.0;
_segment.layer.borderColor = [UIColor cyanColor].CGColor;
[self.view addSubview:_segment];
UISegmentedControl 样式,布布扣,bubuko.com
原文:http://www.cnblogs.com/airy99/p/3912982.html