Latest 1.3.0
Homepage https://github.com/DargonLee/HLSegmentViewController
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Example

clone 项目 然后运行pod install 来看实例效果

简单易用的SegmentViewController,可以快速实现网易新闻,今日头像类似的主页效果

  • 使用简单
  • 方便易用
  • 对项目无浸入性
  • 支持链式编程

  • 动态宽度
    Platform

  • 固定宽度
    Platform

    Requirements

Installation

HLSegmentViewController is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'HLSegmentViewController'

项目中使用

//创建实例对象
HLSegmentViewController *segmentVC = [[HLSegmentViewController alloc]init];
segmentVC = [UIColor lightGrayColor];
[self addChildViewController:segmentVC];

segmentVC.view.frame = self.view.bounds;
[self.view addSubview:segmentVC.view];

segmentBarVC.segmentBar.frame = CGRectMake(0, 0, 300, 35);
segmentBarVC.segmentBar.backgroundColor = [UIColor greenColor];
self.navigationItem.titleView = self.segmentBarVC.segmentBar;

//创建需要添加的子控制器
NSArray *items = @[@"专辑", @"声音", @"下载中"];

TopLineViewController *vc1 = [[TopLineViewController alloc]init];

HotViewController *vc2 = [[HotViewController alloc]init];

VideoViewController *vc3 = [[VideoViewController alloc]init];

//调用实例方法进行创建
[segmentVC setupSegmentItems:items childViewControllers:@[vc1,vc2,vc3]];

//设置属性
[segmentVC.segmentView updateWithConfit:^(HLSegmentViewConfig *config) {
    //普通属性设置
    config.segmentBarColor = [UIColor greenColor];
    //链式编程设置
    config.segmentViewBgColor([UIColor grayColor]).itemFont([UIFont systemFontOfSize:14]);
}];

Author

[email protected]

License

HLSegmentViewController is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "HLSegmentViewController",
    "version": "1.3.0",
    "summary": "u7b80u5355u6613u7528u7684SegmentViewControlleruff0cu53efu4ee5u5febu901fu5b9eu73b0u7f51u6613u65b0u95fbuff0cu4ecau65e5u5934u50cfu7c7bu4f3cu7684u4e3bu9875u6548u679c",
    "description": "u7b80u5355u6613u7528u7684SegmentViewControlleruff0cu53efu4ee5u5febu901fu5b9eu73b0u7f51u6613u65b0u95fbuff0cu4ecau65e5u5934u50cfu7c7bu4f3cu7684u4e3bu9875u6548u679cnu4f7fu7528u7b80u5355 u65b9u4fbfu6613u7528 u5bf9u9879u76eeu65e0u6d78u5165u6027",
    "homepage": "https://github.com/DargonLee/HLSegmentViewController",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "DargonLee": "[email protected]"
    },
    "source": {
        "git": "https://github.com/DargonLee/HLSegmentViewController.git",
        "tag": "1.3.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "HLSegmentViewController/Classes/**/*"
}

Pin It on Pinterest

Share This