GithubHelp home page GithubHelp logo

cdzstarscontrol's Introduction

CDZStarsControl

This is a small and configurable stars control with Animation.

Demo Preview

Changelog

1.0.4
  • Fix 0 star can't show bug

Installation

Manual

Add "CDZStarsControl" files to your project

CocoaPods

Add pod 'CDZStarsControl' in your Podfile

Usage

#import "CDZStarscontrol.h"

First,Init the view, set the delegate ,and config if you want.

- (CDZStarsControl *)starsControl{
    if (!_starsControl) {
        _starsControl = [CDZStarsControl.alloc initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, 50) stars:5 starSize:CGSizeMake(50, 50) noramlStarImage:[UIImage imageNamed:@"star_normal"] highlightedStarImage:[UIImage imageNamed:@"star_highlighted"]];
        _starsControl.delegate = self;
        _starsControl.allowFraction = YES;
        _starsControl.score = 2.6f;
    }
    return _starsControl;
}

And Than,add the view.

[self.view addSubview:self.starsControl];

At last,deal the result in delegate.

- (void)starsControl:(CDZStarsControl *)starsControl didChangeScore:(CGFloat)score{
    self.label.text = [NSString stringWithFormat:@"%.1f",score];//do someting you want
}

Articles

iOS中实现一个支持小数的星星评分组件

Requirements

iOS 8.0 Above

TODO

Contact

License

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

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.