Bug 60392 - Impossible to remove shadow on Android buttons since 2.4.0.18342
Summary: Impossible to remove shadow on Android buttons since 2.4.0.18342
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.5.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on: 60966
Blocks:
  Show dependency tree
 
Reported: 2017-10-26 14:01 UTC by Anonymous
Modified: 2018-02-13 02:07 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Repro solution and screencasts (583.41 KB, application/x-zip-compressed)
2017-10-26 14:01 UTC, Anonymous
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 60392 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Anonymous 2017-10-26 14:01:43 UTC
Created attachment 25466 [details]
Repro solution and screencasts

It seems that Xamarin.Forms 2.4.0.18342 brought along some style changes for buttons in Android. I'm unsure if this was intended or not, but in any case, when setting the background color to transparent there's a shadow that seems impossible to remove. 2.4.0.282 doesn't have this problem. The bug is also present in 2.5.0.19271-pre2.

Repro solution and screencasts attached. Note that if you change the Xamarin.Forms version, you might have to clean/rebuild to see the changes (I had to).
Comment 1 Paul DiPietro [MSFT] 2017-10-27 16:55:09 UTC
For the time being, does using a style such as follows help?

<style name="NoShadowButton" parent="android:style/Widget.Button">
    <item name="android:stateListAnimator">@null</item>
</style>

The issue needs to be discussed internally with regards to the expected behavior.
Comment 2 Anonymous 2017-10-27 16:58:01 UTC
How do I use that style for all buttons? I haven't messed around too much with Android styles yet, so I'm a bit lost there.
Comment 3 Anonymous 2017-11-16 09:00:40 UTC
I tried that style, and while it removes the shadow, it does so for ALL buttons, which is certainly not desired for normal buttons. It also makes all buttons look worse in other ways, e.g. removes the uppercasing of button text.
Comment 4 Joe Brock 2017-11-16 16:53:00 UTC
This is affecting me too. Also looks like setting BorderColor no longer has any effect, with or without the style XML from Paul above.
Comment 5 Anonymous 2018-01-03 09:38:03 UTC
Is there any update on this? The bug seems to prohibit using flat-style buttons on Android, which is a core part of Material Design, so this seems fairly serious.
Comment 6 minzhao 2018-02-11 17:06:09 UTC
Looking for an update here too. this is getting really annoying to deal with... is there any workarounds?
Comment 7 Anonymous 2018-02-12 08:29:20 UTC
Here's a workaround using a dead simple custom renderer on Android and a simple XAML implicit style for iOS support:

https://gist.github.com/cmeeren/a795d0ad40100f4e23ef95699bf59cec