GithubHelp home page GithubHelp logo

msmarksbuttonlist's Introduction

MSMarksButtonList

License MIT Pod version Platform info Support

A group of buttons ,can be used to do a multiple choice component

Usage

Setting up padding:

MSButtonConfigurationModel

@property (nonatomic, assign) CGFloat edgeMargin
leading and trailing padding.
最左边的button和最右边的button距离组件两侧边缘的距离

@property (nonatomic, assign) CGFloat horMargin
Horizontal padding between buttons.
水平方向上button与button之间的距离

@property (nonatomic, assign) CGFloat verMargin
Vertical padding between buttons.
垂直方向上button与button之间的距离

@property (nonatomic, assign) CGFloat buttonHeight
height of button.
button的高度

@property (nonatomic, assign) CGFloat fromTopMargin
padding form top.
组件的top距离父view的top的距离.

@property (nonatomic, assign) CGFloat componentWidth
width of component.
组件的宽度

@property (nonatomic, getter=isHide) BOOL hide
hide when initial.
初始化时是否隐藏.

@property (nonatomic, assign) NSInteger numberInaLine
number of buttons in very line.
每一行button的数量


MSButtonConfigurationModel *configuration = [[MSButtonConfigurationModel alloc] initWithEdgeMargin:0.0f
                                                                                             horMargin:10.0f
                                                                                             verMargin:10.0f
                                                                                          buttonHeight:32.0f
                                                                                         fromTopMargin:160
                                                                                        componentWidth:[[UIScreen mainScreen] bounds].size.width
                                                                                         numberInALine:4];

Initialize buttonList:


MSMarksButtonList *buttonList = [[MSMarksButtonList alloc] initWithDataSource:[NSArray array]
                                                                       buttonType:MSButtonTypeOrderScore
                                                                    configuration:configuration];
                                                                    

Tips
I must convert your data model to button model(MSButtonModel),like example.

Requirements

  • ios 7+
  • ARC

Installation

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

pod "MSMarksButtonList"

Author

LinkRober

License

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

msmarksbuttonlist's People

Contributors

linkrober avatar

Stargazers

 avatar  avatar  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.