How to add star rating to UITableView cell?

后端 未结 4 1526
渐次进展
渐次进展 2021-01-16 03:08

I need to display a bunch of UITableViewCell in my iPhone application. Sample look below. I know how I can enable accessory view and image to UITableView cell

4条回答
  •  野的像风
    2021-01-16 03:32

    1. Take 5 images in a custom cell for stars
    2. Make their outlets in UITableViewCell
    3. create an NSMutableArray *starArray and CFFloat rating inside the interface
    4. inside the cellForRowAtIndexPath rating = any float value that can be 0,0.5,1,1.5 ..... and call (void)rightImageSet: this method will fill in all the images string you required for the particular rating.

    5. In rightImageSet apply the logic You can watch the images for further info.

    6. In a case anything is not clear comment

提交回复
热议问题