When I try to set the background color of a button it's having a transparency effect and the color is not the real one, it's faded. However when I press and hold the button the color is displayed as it should. It's creating misleading button colors in all over the project. How can I remove that transparency?
Android
````
In the HTML:
In the CSS:
Button{
background-color: red;
}
````
Normal button:

Pressed and held:

Hi @rwngallego,
Thank you for your interest in NativeScript.
I tested your scenario and on my side everything seems to work as expected and the Button background-color has been applied as expected. This behavior could be related with some another style set in your project CSS file. it would help if you could give us some more info about the problem or if you could send us sample project, which could be debugged locally.
Thank you for your cooperation in advance.
Regards,
@tsonevn
Hi @rwngallego ,
In css place border-radius - 1;
.Button{
background-color: red;
border-radius: 1;
margin: 10
}
@dhanalakshmitawwa Yes, using border-radius: 1 did the trick. However if this is going to be the desired behavior we should need to add this to the docs in the Button section.
@tsonevn @dhanalakshmitawwa i don't like that much of the border-radius: 1; because on more recent versions of android this makes the button lose the ripple effect
Hi @danielgek,
For the ripple effect you could use nativescript-ripple plugin and for further help you could review the demo app here.
Hope this helps.
@tsonevn i do know that plugin, but it would be nice if {N} handle it out of the box xD i'm not complaining, it's just an opinion ;)
Any news on this bug?
the issue with the background-color is not reproducible with modules 4.1
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Hi @rwngallego ,
In css place border-radius - 1;
.Button{
background-color: red;
border-radius: 1;
margin: 10
}