Giter VIP home page Giter VIP logo

ratingbar's Introduction

RatingBar

评分条(类似于淘宝/京东/1号店/亚马逊等商城类的评分条,支持0.5分哦)

先上图,看一下是否符合你的场景吧!

Function Description

  1. 点击评分
  2. 滑动评分
  3. 个性化设置

How to use

platform:ios, '8.0'

target '*****' do

pod 'JhtRatingBar'
        
end

2. 点击评分

/** 常规初始化方法 */
JhtRatingBar *bar = [[JhtRatingBar alloc] initWithFrame:CGRectMake(([UIScreen mainScreen].bounds.size.width - 280) / 2, 150, 280, 35)];

3. 滑动评分:只要这两个属性不关闭,默认是可以滑动评分的

/** 是否允许可触摸(默认:允许) */
@property (nonatomic, assign) BOOL isEnableTouch;
/** 是否允许滑动选择(默认:允许)(在isEnableTouch = YES的前提下才有意义) */
@property (nonatomic, assign) BOOL scrollSelectEnable;

4. 个性化设置:可以通过设置以下属性做相关设置(半分 && 背景颜色 && 获取最终评分)

/** 是否需要半分(默认不需要) */
@property (nonatomic, assign) BOOL isNeedHalf;
/** 底部视图的颜色(默认:白色) */
@property (nonatomic, strong) UIColor *bgViewColor;

/** 点亮星星发生变化 */
@property (nonatomic, copy) StarChange starChange;
/** 获得的分数 */
@property (nonatomic, assign, readonly) CGFloat scale;
__weak JhtRatingBar *weakBar = bar;
    bar.starChange = ^() {
        NSLog(@"scale = %lf", weakBar.scale);
};

注:1. 假使这样初始化后不做其他属性的传递,评分条相关属性会使用默认值,例:星星总的数量(默认:5)
  2. 假使评分条宽度在初始化设置的时候,不足以放得下所有星星,内部会动态改变其宽度以至于可以放得下所有星星

Remind

  • ARC
  • iOS >= 8.0
  • iPhone \ iPad

Hope

  • If you find bug when used,Hope you can Issues me,Thank you or try to download the latest code of this framework to see the BUG has been fixed or not
  • If you find the function is not enough when used,Hope you can Issues me,I very much to add more useful function to this framework ,Thank you !

ratingbar's People

Contributors

jinht avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ratingbar's Issues

一个建议

兄弟,你这个东西为啥不支持更改星星的图片呢,能不能开发更改星星图片的属性呢??

不够灵活,建议开源

首先感谢作者为闭源开发作出贡献。

此工具(目前只能成为工具)虽已具备基础功能,但灵活性略差,星星大小、间距、图片都没有暴露设置接口,让使用者去修改bundle内的资源实在不妥。

建议作者多为开源做贡献,随后我可能会写一个更灵活评分条。

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.