Setting button background color removes material design touch feedback

GaganSinghGaganSingh USUniversity ✭✭✭

How do i set the background of a button but still keep the touch feedback from android material design?

<Button x:Name="login" Text="LOGIN" TextColor="White" BackgroundColor="Teal" Clicked="OnLoginClick"/>

Answers

  • nrdybynaturenrdybynature SEMember

    Hi Gagandeep! Have you made any progress on this issue?

  • TheRealJasonSmithTheRealJasonSmith USXamarin Team Xamurai

    Try the new AppCompat backend. It properly supports this :)

  • DanWatkinsDanWatkins USMember

    How can the new AppCompat backend be used? I'm utilizing Xamarin.Forms 2 and the following still is problematic (green button has no material effect).

    <?xml version="1.0" encoding="UTF-8"?>
    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Eto6.UI.Tablet.MainPage">
        <ContentPage.Content>
            <StackLayout VerticalOptions="Center" Spacing="10">
                <Button Text="Hello" BackgroundColor="Green" Clicked="OnButtonClicked_Hello" />
                <Button Text="Exit" Clicked="OnButtonClicked_Exit" />
            </StackLayout>
        </ContentPage.Content>
    </ContentPage>
    

    The Android target application has references to Xamarin.Android.Support.v7.AppCompat if that means anything.

  • jr.4127jr.4127 FRMember

    Digging for the same thing, interested by an answer thanks.

  • I have the same issue. Anyone found a solution?

    Thanks! ;)

  • just moved over to using AppCompat and noticed this as well. Did any of you guys ever find a fix for this?

  • Umar3xUmar3x FRMember ✭✭

    Still an issue. Related to https://forums.xamarin.com/discussion/64848/backgroundcolor-changes-button-size

    Any chance to have some feedback from this bug ?

Sign In or Register to comment.