HMSegmentedControl的使用
来源:互联网 发布:基数排序算法 编辑:程序博客网 时间:2024/05/01 11:22
下载地址:https://github.com/HeshamMegid/HMSegmentedControl
HMSegmentedControl *segmented = [[HMSegmentedControl alloc] initWithSectionTitles:@[@"已收公告",@"已发公告"]]; segmented.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleWidth; // 自动调整 segmented.frame = CGRectMake(self.view.bounds.size.width/2-100, 4, 200, 40); segmented.backgroundColor = [UIColor clearColor]; segmented.selectionIndicatorHeight = 3.0f; // 线的高度 segmented.font = [UIFont fontWithName:@"STHeitiSC-Light" size:19.0f]; // 设置字体 segmented.textColor = WHRGB(255, 175, 185); // 字的颜色 segmented.selectedTextColor = [UIColor whiteColor]; // 选中时字体颜色 segmented.selectionIndicatorColor = [UIColor whiteColor]; //线条的颜色 segmented.selectionStyle = HMSegmentedControlSelectionStyleFullWidthStripe; //线充满整个长度 segmented.selectionIndicatorLocation = HMSegmentedControlSelectionIndicatorLocationDown; //线的位置 [segmented addTarget:self action:@selector(segmentedControlChangedValue:) forControlEvents:UIControlEventValueChanged]; self.segmentedControl = segmented; [self.navigationController.navigationBar addSubview:segmented];</span>
typedef enum { //线的样式
HMSegmentedControlSelectionStyleTextWidthStripe,// Indicator width will only be as big as the text width
HMSegmentedControlSelectionStyleFullWidthStripe,// Indicator width will fill the whole segment
HMSegmentedControlSelectionStyleBox, // A rectangle that covers the whole segment
HMSegmentedControlSelectionStyleArrow // An arrow in the middle of the segment pointing up or down depending on `HMSegmentedControlSelectionIndicatorLocation`
} HMSegmentedControlSelectionStyle;
typedef enum { // 线的位置
HMSegmentedControlSelectionIndicatorLocationUp,
HMSegmentedControlSelectionIndicatorLocationDown,
HMSegmentedControlSelectionIndicatorLocationNone// No selection indicator
} HMSegmentedControlSelectionIndicatorLocation;
// 边缘的样式
property (nonatomic,assign)HMSegmentedControlBorderType borderType;
/**
Specifies the border color.
Default is `[UIColor blackColor]`
*/
@property (nonatomic,strong)UIColor *borderColor;
/**
Specifies the border width.
Default is `1.0f`
*/
@property (nonatomic,assign)CGFloat borderWidth;
// 设置内容
@property (nonatomic,strong)NSArray *sectionTitles;
@property (nonatomic,strong)NSArray *sectionImages;
@property (nonatomic,strong)NSArray *sectionSelectedImages;
// 判断点击是哪个
@property (nonatomic,assign)NSInteger selectedSegmentIndex;
- HMSegmentedControl的使用
- HMSegmentedControl分段控制器的学习与使用
- HMSegmentedControl
- 使用HMSegmentedControl实现分段控件
- GUID使用的使用
- ${}的使用
- 的使用
- @[],@()的使用
- ->的使用
- +、-、*、/、%的使用
- &&的使用
- %:的使用
- Makefile中使用$$的使用
- Makefile中使用$$的使用
- Red5的使用--使用日志
- prefernce的使用具体使用
- 【工具使用】git 的使用
- 关于使用AsyncTaskLoader的使用
- 【Linux】 配置vim
- JavaScript Map的实现
- 【代码质量】C++代码质量扫描主流工具深度比较
- Java反射实例及说明
- LDA 线性判别分析
- HMSegmentedControl的使用
- 经典算法面试题及答案
- Caught TypeError while rendering: coercing to Unicode: need string or buffer, NoneType found
- 数据库SQL优化大总结之 百万级数据库优化方案
- 原码, 反码, 补码 详解
- Quartz的简单使用,基于1.X(二)【类的详细解释】
- 数据库(序)
- 自定义Toast 吐出我的风格
- Eclipse中10个最有用的快捷键组合