Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

ListView ItemTemplate with varying number of images inside

$
0
0

I am trying to set up a listView that shows a number of things from my itemsSource, and within those items I want to show a star rating. I am familiar with sfRating and it works great except for the slowdown I have seen when using it multiple times on a page.

I'm unsure how to go about this. I have a bit of code that will take a StackLayout container and a value (0.0-5.0) and show the correct number of filled/empty stars but do not think I am able to insert that container into the template in any way after googling around for awhile. I was hoping I could bind the contents of an empty shell, create it in code and replace it for each item but I haven't found a way to do that.

I am currently thinking I could accomplish this by having 5 filled stars, 5 empty stars, and one half star and bind each one to a value that will let me make it visible or not. That is a pretty ugly solution though and so I'm hoping someone could shed some light on the proper way of doing this? Any help would be appreciated, thanks.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>