Giter VIP home page Giter VIP logo

hlsegmentviewcontroller's Introduction

HLSegmentViewController

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.

hlsegmentviewcontroller's People

Contributors

dargonlee avatar

Stargazers

 avatar  avatar liuchao avatar FuQiangChen avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.