Giter Club home page Giter Club logo

rzscaleplate's Introduction

RZScaleplate

RZScaleplate是一个自定义的标尺控件。使用该控制可以在两个临界值内选择其中的某个值。该控件的使用场景可以用在选择如年龄,身高,体重等情形。项目中用到这个效果,故而写了这么一个控件。 How to use

水平方向的标尺

RZScaleplate *sp_H = [[RZScaleplate alloc]
                 initWithFrame:CGRectMake(20 , 120, 250, 50) oritation:Horizontal];
    
    sp_H.miniValue=0; ////临界点最小值
    sp_H.maxValue=100; ///临界点最大值
    sp_H.stepValue=1; /////每个刻度值
    sp_H.value=[NSNumber numberWithFloat:50]; //////初始值
    
    [sp_H setValueChangedBlock:^(NSNumber *value) {
        ///...标尺valuechanged时的回调block
    }];
    [self.view addSubview:sp_H];

垂直方向的标尺

RZScaleplate *sp_V = [[RZScaleplate alloc]
                 initWithFrame:CGRectMake(20 , 120, 60, 200) oritation:Vertical];
    
    sp_V.miniValue=150; ////临界点最小值
    sp_V.maxValue=250; ///临界点最大值
    sp_V.stepValue=1; /////每个刻度值
    sp_V.value=[NSNumber numberWithFloat:175]; //////初始值
    
    [sp_V setValueChangedBlock:^(NSNumber *value) {
        ///...标尺valuechanged时的回调block
    }];
    [self.view addSubview:sp_V];

Requirements

RZScaleplate requires either iOS 5.0 and above.

License

RZScaleplate is available under the Apache License. See the LICENSE file for more info.

ARC

RZScaleplate uses ARC.

Contact

Rey Zhang

rzscaleplate's People

Contributors

reyzhang avatar

Stargazers

qingliu avatar CGPointZero avatar  avatar Four avatar Billy Chen avatar

Watchers

 avatar  avatar James Cloos avatar

rzscaleplate's Issues

你好,加个dragable吧

有些场景不是拖动来pick value的,而是被动的改变,如地理朝向,俯仰角度,瞄准角度等,随着特定行为而被动改变,此情况下应该禁止使用拖动。

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.