react-native-ratings icon indicating copy to clipboard operation
react-native-ratings copied to clipboard

How to remove the white background around the star

Open vikalpjain opened this issue 5 years ago • 11 comments

I'm using star rating and my app has a different background color than white. The white square around the star looks very odd. Is there any way of removing that?

vikalpjain avatar Jun 30 '19 08:06 vikalpjain

Solution: https://github.com/Monte9/react-native-ratings/issues/26#issuecomment-401279355

andydev404 avatar Jul 04 '19 17:07 andydev404

@andydev404 Actually this is not a solution. When I set it to "transparent" whole star thing is just gone. tintColor does not work for the removal of the background.

WrathChaos avatar Jul 15 '19 16:07 WrathChaos

facing same issue? anyone found solution?

Sanan4li avatar Feb 12 '20 18:02 Sanan4li

@Sanan4li change the tintColor prop as the background of the parent view

vieiraricardo avatar Mar 11 '20 15:03 vieiraricardo

@Sanan4li change the tintColor prop as the background of the parent view

What if I want it to be transparent? Is there a solution, even a workaround?

blueberry6401 avatar Mar 12 '20 04:03 blueberry6401

I had the same issue. It's actually because your image should not be a star with a transparent background. It should be a background with a transparent star. Then you can change the background of your image directly. But it's pretty annoying if you have gradient on your page for example. It's currently not a very satisfying solution For those interested I made a template of an image to use : StarFrame

Vahradrim avatar Apr 25 '20 17:04 Vahradrim

Hi, To change the white square around the star you have to add the "tintColor" property to your Rating tag and make the color of your choice :

              <Rating showRating 
               fractions={1} 
               ratingCount={5}
               startingValue={3.3} 
               imageSize={20}
               type='star'
               tintColor='#E6E6E6'
              />

maciass2008 avatar May 21 '20 05:05 maciass2008

@maciass2008 Thanks for the answer. However, if I want to set it to be transparent I just get one square that shows the rating. please see what happens when I set it to transparent Capture

gilad7 avatar Dec 28 '20 20:12 gilad7

@maciass2008 Thanks for the answer. However, if I want to set it to be transparent I just get one square that shows the rating. please see what happens when I set it to transparent Capture

Same issue here

flora8984461 avatar Feb 13 '21 22:02 flora8984461

@maciass2008 Thanks for the answer. However, if I want to set it to be transparent I just get one square that shows the rating. please see what happens when I set it to transparent Capture

Same issuue here

pati-rosa avatar Mar 09 '21 18:03 pati-rosa

You can't change background color because this use actual background image. You can custom image star to fit with your background screen Screen Shot 2021-07-19 at 10 39 31 AM And this is my custom image Screen Shot 2021-07-19 at 10 43 24 AM

Raden-Hor avatar Jul 19 '21 03:07 Raden-Hor