You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Background-color not showing correctly in Android 4.2 #1638
When setting the background color for a button in the CSS file, the color goes to a "light" version on Android 4.2. When the button is tapped, the color is shown correctly for that fraction of second.
In Android 5.0 onwards, this problem does not occur.
This happens in version 1.6.1 of TNS. Before I had the 1.5.1 version and this problem didn't happen.
This was tested with Nexus 7 (2012) with Android 4.4, and a phone with Android 4.2. For emulators it was tested with genymotion and android official emulator with android versions 4.2 to 6.0.
Long story short we kept the default background drawable vs previous version where the Button background was completely replaced with solid color. Now the background drawable will be only colorized. If you still need the previous behavior you can set for example border-width:0.1.
I am new in "software dev" and I am learning as I go, so it is still difficult for me to see the logic in your explanation. But why does this only happen in Android previous to 5.0? Is it supposed to?
By the way, who marks this as resolved? Me? You? Or other NativeScript responsable?
In my opinion the difference comes from the fact that Android themes for Button in 4.2 and 6.0 are different. The idea of our fix was to not override the default button background but just apply the color to the existing background. In different versions of Android backgrounds for buttons are different and for example may nice ripple effect and we don't want to override this with just a solid color.
Either you or I can close this issue (or some other collaborator of this repo).
Activity
enchev commentedon Feb 25, 2016
Hey @gfalves,
I believe that this is related to #1296
Long story short we kept the default background drawable vs previous version where the Button background was completely replaced with solid color. Now the background drawable will be only colorized. If you still need the previous behavior you can set for example
border-width:0.1.gfalves commentedon Feb 25, 2016
Hi @enchev ,
Thank you for the tip. It works now!
I am new in "software dev" and I am learning as I go, so it is still difficult for me to see the logic in your explanation. But why does this only happen in Android previous to 5.0? Is it supposed to?
By the way, who marks this as resolved? Me? You? Or other NativeScript responsable?
Thank you once again.
enchev commentedon Feb 25, 2016
In my opinion the difference comes from the fact that Android themes for Button in 4.2 and 6.0 are different. The idea of our fix was to not override the default button background but just apply the color to the existing background. In different versions of Android backgrounds for buttons are different and for example may nice ripple effect and we don't want to override this with just a solid color.
Either you or I can close this issue (or some other collaborator of this repo).
gfalves commentedon Feb 25, 2016
Cool. Thanks =)
Rohitwithyou commentedon May 29, 2018
I am still facing the problem ,when i try to set the background color in textview.
lock commentedon Aug 26, 2019
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.