Giter Club home page Giter Club logo

vosegmentedcontroldemo's Introduction

VOSegmentedControl

  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"}];

vosegmentedcontroldemo's People

Contributors

pozi119 avatar

Watchers

 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.