测试测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
Released最新版本 | 2014年12月 |
由Kien NGUYEN维护。
添加了取消选择部分的可能性(通过触摸所选部分)。
segmentedControl.deselectable = YES;
HMSegmentedControl 是 UISegmentedControl 的替代品,模仿了 Google Currents 和其他 Google 产品的分段控制器样式。
HMSegmentedControl.h
和 HMSegmentedControl.m
添加到您的项目中。QuartzCore.framework
添加到您的链接框架中。#import "HMSegmentedControl.h"
在您想添加控制器的位置。以下代码将创建一个具有默认样式的分段控制
HMSegmentedControl *segmentedControl = [[HMSegmentedControl alloc] initWithSectionTitles:@[@"One", @"Two", @"Three"]];
segmentedControl.frame = CGRectMake(10, 10, 300, 60);
[segmentedControl addTarget:self action:@selector(segmentedControlChangedValue:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:segmentedControl];
包括一个演示项目,展示如何完全自定义控制器。
scrollEnabled
属性实现的水平滚动。请检查示例项目如果您在您的应用程序中使用HMSegmentedControl或了解使用该库的应用程序,请将其添加到这个列表中。
HMSegmentedControl使用MIT许可证的条款进行许可。有关详细信息,请参阅LICENSE文件。
如果这段代码对您有帮助,我希望听到您的反馈。