https://github.com/devdragonli/lflsegmentcontrol
🚥 SegmentSwitchTab
https://github.com/devdragonli/lflsegmentcontrol
custom-elements custom-view helper-tool segementation segment
Last synced: 29 days ago
JSON representation
🚥 SegmentSwitchTab
- Host: GitHub
- URL: https://github.com/devdragonli/lflsegmentcontrol
- Owner: DevDragonLi
- License: mit
- Created: 2016-01-03T06:48:32.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-07-25T04:11:51.000Z (almost 5 years ago)
- Last Synced: 2025-04-01T12:11:11.376Z (about 2 months ago)
- Topics: custom-elements, custom-view, helper-tool, segementation, segment
- Language: Objective-C
- Homepage:
- Size: 279 KB
- Stars: 27
- Watchers: 3
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LFLSegmentControl: 简单易用分段控件
> 模仿网易新闻和搜狐新闻的首页效果,滑动切换不同栏目视图
## Stargazers over time
[](https://starcharts.herokuapp.com/DevDragonLi/iOSDevDemo)
## 效果图

## 1.Installation
- With [CocoaPods](http://cocoapods.org), add this line to your Podfile.
```
pod 'SegmentControlLFL', '~> 2.0.0'
pod install```
- 也可以下载源码后把LFLUISegmentedControl文件夹直接拖入工程即可,可以clone下拖入工程使用即可.这个是最新版
## 2.代码演示部分
```
1.创建控件,建议高度37,其他数值,需要修改源码,适应居中标题view
self.LFLuisement=[LFLUISegmentedControl segmentWithFrame:CGRectMake(0, 64,self_Width ,37) titleArray:@[@"演示标题",@"DragonLi",@"LFL2018",@"Github"] defaultSelect:0];
// 非必须设置属性
/*
2, 自定义各类颜色 和 字体大小
[self.LFLuisement titleColor:[UIColor greenColor] selectTitleColor:[UIColor redColor] BackGroundColor:[UIColor grayColor] titleFontSize:13];
3. 设置下滑线颜色 .默认为主流的红色
[self.LFLuisement lineColor:[UIColor brownColor]];
*/
self.LFLuisement.delegate = self;
[self.view addSubview:self.LFLuisement];#pragma mark ---LFLUISegmentedControlDelegate
/**
* 点击标题按钮
*
* @param selection 对应下标 begain 0
*/
-(void)uisegumentSelectionChange:(NSInteger)selection{
// 可以根据选中下标执行不同操作,详见demo
}```
Requirements
==============
This library requires `iOS 6.0+` and `Xcode 6.0+`.## 有任何问题,请及时 issues me `[email protected]`
## 已知问题,`如果分段数组大于6个,因为没有采取滚动视图承载`,可能会有显示问题,修改下源码即可.但是对于一般简单标题需求可完美使用.