GPCustomSegment 通过 CocoaPods 可用。要安装它,只需将以下行添加到您的 Podfile 中
pod "GPCustomSegment"
_switchSegment = [[GPCustomSegment alloc] initWithImages:@[@"image", @"image",@"image"]
disabledImageColor:[UIColor lightGrayColor]
selectedImageColor:[UIColor yellowColor]
pressureViewColor:[UIColor redColor]
backgroundColor:[UIColor whiteColor]
borderColor:[UIColor clearColor]
andFrame:CGRectMake(30, 50, 150, 50)];
[_switchSegment addTarget:self
action:@selector(segmentedControlValueChanged:)
forControlEvents:UIControlEventValueChanged];
[self.view addSubview:_switchSegment];
George Prokopchuk, [email protected]
GPCustomSegment 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。