Latest 1.0.0
Homepage https://github.com/pozi119/VOSegmentedControlDemo
License GPL V2.0
Platforms ios 7.0
Authors

License Apache 
CocoaPods 
CocoaPods 
Support 
Build Status

更新

2016.5.4 添加cocoapods支持

安装

cocoapods导入:

    pod 'VOSegmentedControl'

手动安装:
VOSegmentedControlDemoVOSegmentedControl 文件夹拖入项目之中.

使用说明

  1. 支持图片和文字,包含6种简单排版: 只有文字, 只有图片, 图片在上下左右
    只有图片时,图片如果比分段大,则只铺满整个分段,若比分段小,则为图片大小居中
    图片在左,右时,图片层为正方形, 最大边长是分段的高度,
    图片在顶部或者底部时, 图片的最大高度为 分段高度 x 0.618

  2. 指示器支持3种类型: 顶部线条,底部线条,方框; 可设置indicatorThickness和indicatorCornerRadius 变为圆角指示器, 当indicatorThickness = 0时, 指示器不显示

  3. 指示器移动效果: 平滑移动,弹簧效果.

  4. 可设置选中/未选中时文字的字体, 颜色

  5. 可设置选中时的背景色,如果指示器设置成圆角的,背景也变成圆角

  6. 可设置不选择任何分段

  7. 指示器移动效果可以自己写: 在VOIndicatorAnimation中加相应的方法

  8. 可再Storyboard中添加UIView,更改对应的Class为VOSegmentControl,在storyboard中添加keypath设置对应参数(枚举变量设置对应的NSNumber值).代码中只用设置分段内容如:

    self.segmentControl5.segments = @[@{VOSegmentText: @"A", VOSegmentImage: @"open", VOSegmentSelectedImage: @"close"},
    @{VOSegmentText: @"B", VOSegmentImage: @"open", VOSegmentSelectedImage: @"close"},
    @{VOSegmentText: @"C", VOSegmentImage: @"open", VOSegmentSelectedImage: @"close"},
    @{VOSegmentText: @"D", VOSegmentImage: @"open", VOSegmentSelectedImage: @"close"},
    @{VOSegmentText: @"E", VOSegmentImage: @"open", VOSegmentSelectedImage: @"close"},
    @{VOSegmentText: @"F", VOSegmentImage: @"open", VOSegmentSelectedImage: @"close"},
    @{VOSegmentText: @"G", VOSegmentImage: @"open", VOSegmentSelectedImage: @"close"},
    @{VOSegmentText: @"H", VOSegmentImage: @"open", VOSegmentSelectedImage: @"close"},
    @{VOSegmentText: @"I", VOSegmentImage: @"open", VOSegmentSelectedImage: @"close"}];

Latest podspec

{
    "name": "VOSegmentedControl",
    "version": "1.0.0",
    "summary": "A segmented control with multi styles",
    "homepage": "https://github.com/pozi119/VOSegmentedControlDemo",
    "license": {
        "type": "GPL V2.0",
        "file": "LICENSE"
    },
    "authors": {
        "pozi119": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/pozi119/VOSegmentedControlDemo.git",
        "tag": "1.0.0"
    },
    "source_files": [
        "VOSegmentedControlDemo/VOSegmentedControl",
        "VOSegmentedControlDemo/VOSegmentedControl/*.{h,m}"
    ]
}

Pin It on Pinterest

Share This