SfButton click animation is not working in Android and iOS devices but works fine in UWP devices

SfButton ControlTemplate initialization is not showing the button pressed animation in Android and iOS devices.


In our Xamarin.Forms app and I am using the SyncFusion button inside the ControlTemplate for displaying the button with Grid columns. When I press this button from the UWP app, it shows the button click animation but when I use it from Android/iOS, the click event is triggering, but the Button click animation is not there.


Please find the ControlTemplate code



<ControlTemplate x:Key="ButtonWithStripTemplate">

        <sfButton:SfButton CornerRadius="4" IsEnabled="{TemplateBinding IsEnabled}" BorderWidth="0" Margin="3"

            Command="{TemplateBinding Command}" CommandParameter="{TemplateBinding CommandParameter}"

            AutomationId="{TemplateBinding ContentTitle}">

            <Grid ColumnDefinitions="16,*" ColumnSpacing="0" RowSpacing="0">

                <StackLayout Grid.Column="0" BackgroundColor="{TemplateBinding StripBackgroundColor}">

                    <Label Text="{TemplateBinding StripText}" TextColor="White" VerticalOptions="FillAndExpand"

                           HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>

                </StackLayout>

                <StackLayout Grid.Column="1" BackgroundColor="White">

                    <Label Text="{TemplateBinding ContentTitle}" TextColor="Black" VerticalOptions="FillAndExpand"

                           FontSize="{StaticResource FontSizeMedium}" Margin="8,0,0,0" HorizontalTextAlignment="Start"

                           VerticalTextAlignment="Center"/>

                </StackLayout>

                <BoxView Grid.ColumnSpan="2" BackgroundColor="Gray">

                    <BoxView.Opacity>

                        <Binding Path="IsEnabled" Source="{RelativeSource TemplatedParent}">

                            <Binding.Converter>

                                <converters:BoolToObjectConverter x:TypeArguments="x:Double"

                                    TrueObj="0"

                                    FalseObj="0.7"/>

                            </Binding.Converter>

                        </Binding>

                    </BoxView.Opacity>

                </BoxView>

            </Grid>

        </sfButton:SfButton>

    </ControlTemplate>



Please find the template initialization code

CustomButtonWithStrip button = new CustomButtonWithStrip

               {

                    ControlTemplate = Application.Current.Resources["ButtonWithStripTemplate"] as ControlTemplate

                };


I have also created a ticket for the same issue here.

Please help me for finding the root cause of why the animation is not showing on Android/iOS devices.


1 Reply 1 reply marked as answer

PR Preethi Rajakandham Syncfusion Team May 22, 2023 06:53 AM UTC

Hi Afsal,

As responses have been updated on the ticket created by you, please refer to that specific ticket for any further updates. Accordingly, we will be closing this thread.

Regards,

Preethi R


Marked as answer
Loader.
Up arrow icon