项目介绍:
FMLStarView 简单的星级评价的控件
https://github.com/FelixMLians/FMLStarView
Introduction
This is a simple view of star review.
If you feel good, please give me a star, thank you very much! ⭐️
InstallationNon-CocoaPods Installation
Just drag the FMLStarView folder into your project.And change the star images as you like;
Usage
- Use by including the following import:
[Objective-C] 查看源文件 复制代码
#import "FMLStarView.h"
_starView = [[FMLStarView alloc] initWithFrame:CGRectMake(0, 0, 150, 25)
numberOfStars:numberOfStars
isTouchable:YES
index:index];
_starView.currentScore = currentScore;
_starView.totalScore = totalScore;
_starView.isFullStarLimited = isFullStarLimited;
_starView.delegate = controller;
[self addSubview:_starView];
- Delegate (@optional):
[Objective-C] 查看源文件 复制代码
#pragma mark - FMLStarViewDelegate
- (void)fml_didClickStarViewByScore:(CGFloat)score atIndex:(NSInteger)index {
NSLog(@"score: %f index:%zd", score, index);
}
DEMO 直接下载:
