NSArray *array = [NSArray arrayWithObjects:@”职位详情”,@”公司信息”, nil];
_segmentControl = [[UISegmentedControl alloc] initWithItems:array];
_segmentControl.frame = CGRectMake(0, 0, 170, 30);
_segmentControl.frame = [GeneralUIFactory autoLayout:_segmentControl];
_segmentControl.tintColor = [UIColor whiteColor];
_segmentControl.selectedSegmentIndex = 0;
NSDictionary* selectedTextAttributes = @{NSFontAttributeName:[UIFont setFontSize:13],NSForegroundColorAttributeName:[UIColor getColor:@”#14aae0”]};
[_segmentControl setTitleTextAttributes:selectedTextAttributes forState:UIControlStateSelected];
NSDictionary* unselectedTextAttributes = @{NSFontAttributeName:[UIFont setFontSize:13],NSForegroundColorAttributeName: [UIColor whiteColor]};
[_segmentControl setTitleTextAttributes:unselectedTextAttributes forState:UIControlStateNormal];
[_segmentControl addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged];
self.navigationItem.titleView = _segmentControl;