uisegmentcontrol的创建基本方法
创建segmentcontrol
NSArray *segmentedArray = [[NSArray alloc]initWithObjects:@"打印失败",@"发送失败",nil];
self.segmengt = [[UISegmentedControl alloc]initWithItems:segmentedArray];
[self.segmengt setFrame:CGRectMake((self.contentView.viewWidth - 240) / 2,85,240, 30)];
self.segmengt.selectedSegmentIndex = 0;
[self.segmengt setTintColor:[UIColor colorWithHex:0x4ac45f alpha:1.0f]];
[self.contentView addSubview:self.segmengt];
segmengtcontrol的监听事件为addTarget方法添加