Forum Xamarin Xamarin.Forms

Weird Pressed shadow in android after updating to XF 2.5

vasilytserejvasilytserej USMember ✭✭

After upgrading to XF 2.5 I have a weird small shadow on every android button after pressing them.
https: // =1V3LMp5o1f8hwaPZL3jTA4b8jJToyq-5t
here is a video of what happens after I press a button.

here is the code of the button

                <Button HeightRequest="60"
                        TextColor="{StaticResource Primary}"
                        BackgroundColor="{StaticResource PrimaryAlternate}"/>


  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭
    edited May 2018

    FYI: Your link doesn't work - at least from my office.

    Did you check the Xamarin nuget issues to see if it has been reported?

    I don't know if this is what you mean by 'shadow' but we've been seeing a rectangle, smaller than the button, starting at 0,0 that appears on the button when it is tapped. I think its supposed to be part of the built-in animation from when a button is tapped, but under certain circumstances it doesn't use the full size of the button. It isn't happening in all uses of the button. So I think it might be related to how it is nested in another container like a Grid versus StackLayout... or if a Style is applied. Some magic combination that causes it. But I haven't cared enough to spend a day researching it and the bosses haven't cared enough to make it an assigned priority.

    Here are stills taken out of a video capture..

  • vasilytserejvasilytserej USMember ✭✭
    Yes. That is the issue that i am having.
    I will try different nesting combinations and see.
    There isnt a single post I have seen about people complaining about this problem.
  • MarcoTronconeMarcoTroncone GBUniversity ✭✭✭

    I have the same issue in all my apps with Xamarin.Forms.
    I hope they can fix it but probably for them this is a low priority bug

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    @MarcoTroncone said:
    I have the same issue in all my apps with Xamarin.Forms.
    I hope they can fix it but probably for them this is a low priority bug

    Its not any priority bug - until someone takes the time to register it as an issue and provide a sample project for them to reproduce it.

  • vasilytserejvasilytserej USMember ✭✭
    edited June 2018

    @MarcoTroncone installed pre-release of 3.1 and they still haven't fixed that bug. I don't know how something so obvious gets overlooked

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    @vasilytserej @MarcoTroncone

    I don't know how something so obvious gets overlooked

    Because nobody is getting paid by the bug fixed, nor docked pay for bugs being carried over from one iteration to the next.
    I guarantee if there was a bonus program for fixing this stuff it would get done.

  • vasilytserejvasilytserej USMember ✭✭

    @ClintStLaurent @MarcoTroncone

    Jan 24, 2019 Xamarin Forms 3.4 and still no fix for the issue.

    did you manage a workaround?

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭
    edited January 2019

    We just stopped using Button a long time ago. Its inconsistent between platforms and the OS makers keep changing the UI expectation... shadow, no shadow, frame, disabled color, blah blah blah.

    So we made a control from grid... gave it an Image placement and Label that we could fully control. Added events and bindings. Now that is our CustomButton that looks the same everyplace and does what we want it to do - and nothing more.

  • vasilytserejvasilytserej USMember ✭✭

    @ClintStLaurent thanks for the reply. I have had trouble in the past mimicking the behavior of the button using other controls.
    Mainly with the responsiveness of the click event. I think I let it slip for now.

  • MarcoTronconeMarcoTroncone GBUniversity ✭✭✭

    I'm working with the latest Xamarin.Forms and it seems that now the buttons work well on Android (testing on android 9).

  • vasilytserejvasilytserej USMember ✭✭

    maybe is fixed with android 9 but I am testing in a S9 with android 8.1 with latest Xamarin Forms and it doesn't work.
    Also this doesn't happen with vanilla android phones. Like Google Pixel.

  • StandaMikesStandaMikes USMember ✭✭

    I created a custom renderer for a button on Android. It works for our project as a workaround. However, I already got some responses on github, that it did not work for them when they used some MVVM frameworks and commands.

    Give it a try and you will see.

  • vasilytserejvasilytserej USMember ✭✭
    They fixed that in android 9
Sign In or Register to comment.