RateView
是一个创建包含评分星标的可自定义评分视图的UIView
子类。它以百分比填充的方式填写星星。可用于:
canRate = NO
或}canRate = YES
。pod 'RateView'
配置RateView就像这样简单
RateView* rv = [RateView rateViewWithRating:3.7f];
[self.view addSubview:rv];
RateView从这里接管。
0.0
到5.0
之间的rating
。RateView附带了一组属性用于根据需要进行自定义:rating
rating
: 与RateView一起使用的评分(0.0f至5.0f)
canRate
: 用户是否可以使用评分视图进行评分(权限标志)
step
: 用户可以评分时的评分步骤(0.0f至1.0f)
starNormalColor
: 评分星的背景颜色
starFillColor
: 评分星的填充颜色
starBorderColor
: 评分星的边框颜色
starFillMode
: 星形填充模式水平、垂直或轴向
starSize
: 星形大小(宽=高=大小),以点为单位
delegate
: 注册以监听评分更改
Given that UIColor is capable of color patterns handling made from images,
RateView can be used to take advantage of this feature.
Demo app includes almost all of the property usages through a pretty basic UITableView example.
You can go through it to see these in action at first.