ios实现类似美团的星星评价
1.支持只显示评分,不可评价
2.可滑动评价分数,点击评价分数
3.支持全星,半星,不完整星星评价

实现:
/**
实例化
@param frame frame
@param starCount 星星的数量
@param starStyle 评分样式
@param isAllowScroe 是否可以评分,还是只是显示分数
@return starView
*/
- (instancetype)initWithFrame:(CGRect)frame starCount:(NSInteger)starCount starStyle:(StarStyle)starStyle isAllowScroe:(BOOL)isAllowScroe ;
使用:
直接拖JZLStarView文件夹到项目 ,简单代码调用即可
_starView = [[JZLStarView alloc] initWithFrame:CGRectMake(50, 50, 200, 80) starCount:8 starStyle:HalfStar isAllowScroe:YES];
[self.view addSubview:self.starView];
//对于只显示分数,不能评分的,设置isAllowScroe,然后指定分数就好
_starView.currentScore = 3.2;
使用中遇到问题麻烦大家留言,我会及时更改,如果帮到你,麻烦给个star鼓励一下
Demo:https://github.com/allenjzl/JZlStarView.git
网友评论