robinmanuelthiel / flexbutton

Flexible button control for Xamarin.Forms
MIT License
240 stars 34 forks source link

Image stays dark after pressed #72

Open SmatchyLaPaglia opened 5 years ago

SmatchyLaPaglia commented 5 years ago

Describe the bug When an image is used, and the button is pressed, the image darkens to show the button is being pressed, but the image stays darkened after the press is lifted.

To Reproduce Steps to reproduce the behavior: Using Visual Studio for Mac, Community edition, 7.8.3 build 2. Can be seen using this simple Forms code:

XAML:

<?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="Tests.TestFlexButtonIcon"
             xmlns:flex          ="clr-namespace:Flex.Controls;assembly=Flex">
            <flex:FlexButton                              
        x:Name="testButton"
        BackgroundColor="Green"
                             Padding="0"
                             WidthRequest            ="70"
                             HeightRequest           ="70"
                             HorizontalOptions       ="Center"
                             VerticalOptions         ="Center"
                             />
</ContentPage>

Code-behind:

using System.Reflection;
using Xamarin.Forms;

namespace Tests
{
    public partial class TestFlexButtonIcon : ContentPage
    {
        public TestFlexButtonIcon()
        {
            InitializeComponent();
            testButton.Icon =  ImageSource.FromResource("Test.flowerTest.jpg", typeof(TestFlexButtonIcon).GetTypeInfo().Assembly);
        }
    }
}

Expected behavior The image should return to its normal state after the press on the button ends.

Please complete the following information:

SmatchyLaPaglia commented 5 years ago

Btw my current workaround is to re-define the icon property every time the button is pressed. Works ok.

NickeManarin commented 5 years ago

Yeah, the same happens when running on an Android from a Windows machine

robinmanuelthiel commented 3 years ago

Can't really reproduce and don't 100% understand the issue. Could you provide a sample project for me to reproduce, please?