DXStarRatingView
Simple and easy to use StarRatingView for iOS
Install / Use
/learn @s3lvin/DXStarRatingViewREADME
DXStarRatingView

Simple and easy to use StarRatingView for iOS
Steps to use:
-
Add DXStarRatingView.h,DXStarRatingView.m, rating-star-on.png and rating-star-off.png into your project.
-
Just add an UIView in the ViewController or TableViewCell in which you want to use the star rating view. And specify the custom class in the inspector on right pane as
DXStarRatingView.
-
If you are NOT using auto layout then the
DXStarRatingViewcan calculate its own frame size according to the rating-star-on.png image. But if you use auto-layout then you need to be careful about the frame of the rating view. Use this formula to find the correct frame size to assign it in XIB.
frame.size.width = (starImageOn.size.width*5)+(4*kStarPadding)
kStarPadding is a macro to define the gap between the stars. By default it is 1.0f px and it looks good. You are encouraged to configure it yourself to suit your need.
frame.size.height = starImageOn.size.height
Not much to say about height.
Create an IBOutlet for the view
@property (weak, nonatomic) IBOutlet DXStarRatingView *starRatingView;
In viewDidLoad or wherever you want to configure the star rating view, add the following code
[self.starRatingView setStars:4 callbackBlock:^(NSNumber *newRating) { NSLog(@"didChangeRating: %@",newRating); }];
License
MIT Licensed
http://opensource.org/licenses/MIT
Related Skills
node-connect
351.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
