TQStarRatingView

by TinyQ

iOS 星星评分视图控件,点击和滑动评分。

208 Stars 49 Forks Last release: over 3 years ago (v1.1) MIT License 41 Commits 2 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

TQStarRatingView

星星评分控件

iOS 星星评分视图控件,点击和滑动评分。

控件效果

Image text

初始化

TQStarRatingView *starRatingView = [[TQStarRatingView alloc] initWithFrame:CGRectMake(30, 200, 250, 50)
                                                                  numberOfStar:5];
starRatingView.delegate = self;
[self.view addSubview:starRatingView];

委托回调处理分数变更

-(void)starRatingView:(TQStarRatingView *)view score:(float)score{
    self.scoreLabel.text = [NSString stringWithFormat:@"%0.2f",score * 10 ];
}

用代码设置分数 参数需要在0-1之间。

[self.starRatingView setScore:0.5f withAnimation:YES];

[self.starRatingView setScore:0.5f withAnimation:YES completion:^(BOOL finished){
    NSLog(@"%@",@"starOver");
}];

About TinyQ

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.