Skip to content

Simple and easy to use tools of slide tab / 简单易用的滑动标签栏工具

License

Notifications You must be signed in to change notification settings

AndyCuiYTT/SliderViews

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SliderViews

Build Status CRAN

简介

SliderViews 简单易用的滑动标签工具,『标签栏工具』『滑动视图工具』可单独使用.

安装

pod 'SliderViews'

使用示例

SegmentedView 使用

SegmentedView: 标签栏工具,使用需要实现 YTTSegmentedViewDelegate 代理方法.

let segmented = YTTSegmentedView()
segmented.delegate = self // 实现 YTTSegmentedViewDelegate
segmented.addTitleItems(["SliderView1","SliderView2","SliderView3"], isSelected: 1)
segmented.backgroundColor = UIColor.cyan
self.view.addSubview(segmented)
segmented.snp.makeConstraints { (make) in
    make.left.right.centerY.equalToSuperview()
    make.height.equalTo(50)
}

SliderView 使用

SliderView: 滑动视图工具,使用需要实现YTTSliderViewDelegate代理

let sliderView = YTTSliderView()
sliderView = self // 实现 YTTSliderViewDelegate
let view1 = UIView()
view1.backgroundColor = UIColor.cyan
let view2 = UIView()
view2.backgroundColor = UIColor.orange
let view3 = UIView()
view3.backgroundColor = UIColor.blue
sliderView.addChildViews([view1, view2, view3], isSelected: 1)
self.view.addSubview(sliderView)
sliderView.snp.makeConstraints { (make) in
    make.edges.equalToSuperview()
}

TabSliderView 使用

TabSliderView: SegmentedControl 与 SliderView 组合使用.

let tabSliderView = YTTTabSliderView()
tabSliderView.addSubviews([("SliderView1",view1),("SliderView2",view2),("SliderView3",view3)])
view.addSubview(tabSliderView)
tabSliderView.snp.makeConstraints { (make) in
    make.edges.equalToSuperview()
}

反馈

如果您有什么好的修改建议,可以发邮件到[email protected], 也欢迎到我的博客AndyCuiの博客一起讨论学习~

About

Simple and easy to use tools of slide tab / 简单易用的滑动标签栏工具

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published