Xamarin.forms: Frame Tap Gesture not working when using Visual="Material" in iOS

Created on 12 Mar 2019  路  9Comments  路  Source: xamarin/Xamarin.Forms

I have updated my Xamarin Forms to 3.6. I've set Frame visual to material but the tap gesture is not working in iOS. I've tried using command and Tapped event as well but nothing works out. If i remove the visual from frame then everything works fine. I've added "Xamarin.Forms.Visual.Material" nuget package in iOS and had intialized it in AppDelegate.cs file after adding this package, the frame tap event is not working.

Steps to Reproduce

create frame with material option and add tap gesture to it.

<Frame Visual="Material">
          <Frame.GestureRecognizers>
                     <TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped" />
          </Frame.GestureRecognizers>
</Frame>

Expected Behavior

Tap Event should fire.

Actual Behavior

Tap Event does not fire.

Basic Information

  • Version with issue: 3.6.0.220655
  • Last known good version: 3.5

Sample File :

FormsApp.zip

gestures 馃枛 visual 3 in-progress iOS 馃崕 bug

Most helpful comment

I also have this problem and have to do this workaround :

Visual="{OnPlatform Default=Material, iOS=Default}"

Is that bug going to be fixed soon ?

All 9 comments

I am also facing same behavior. Please check

Also i have noticed that Data Triggers are also not getting triggered.

                              <Button
                                    Visual="Material"
                                    x:Name="btnControlPanel"
                                    Command="{Binding Source={x:Reference mainPage}, Path=BindingContext.SelectedControlPanelCommand}"
                                    CommandParameter="{Binding .}"
                                    Text="{Binding Title}"
                                    CornerRadius="20"
                                    Padding="20,0">
                                    <Button.Triggers>
                                        <DataTrigger
                                            TargetType="Button"
                                            Binding="{Binding IsActive, Mode=OneWay}"
                                            Value="True">
                                            <Setter
                                                Property="BackgroundColor"
                                                Value="{StaticResource primaryLightColor}" />
                                        </DataTrigger>
                                        <DataTrigger
                                            TargetType="Button"
                                            Binding="{Binding IsActive, Mode=OneWay}"
                                            Value="False">
                                            <Setter
                                                Property="BackgroundColor"
                                                Value="{StaticResource primaryDarkColor}" />
                                        </DataTrigger>
                                        <EventTrigger
                                            Event="Clicked">
                                            <appTriggers:BeginAnimation
                                                Animation="{StaticResource storyBoardButtonAnimation}" />
                                        </EventTrigger>
                                    </Button.Triggers>
                                </Button>

We are also facing this issue. Please consider this in the future release for fixes.

Any update with this? I had the same problem, when I removed visual=Material, it started working

I also have this problem and have to do this workaround :

Visual="{OnPlatform Default=Material, iOS=Default}"

Is that bug going to be fixed soon ?

I also have this problem on iOS, here is my workaround:
` HeightRequest="100"
WidthRequest="100"
HorizontalOptions="FillAndExpand"

    VerticalOptions="FillAndExpand">

    <Frame
      Visual="Material"
       >
  contents....
    </Frame>
    <Frame Padding="0"
           HasShadow="False"
           Visual="Default"
           x:Name="touchFrame"
           Margin="0"
           Opacity=""
           VerticalOptions="FillAndExpand"
           HorizontalOptions="FillAndExpand"
           BackgroundColor="Transparent" />
</Grid>`

And add TapGestureRecognizer on touchFrame, the idea is cover the material frame with a transparent default frame on it.

Would love to see this fixed. Currently working on an app with a lot of card-like elements that I am having to apply @nathan1658's fix to.

This is happening to me as well, I would love to see this issue fixed so I don't have to use workarounds

Still not working. All other tap gestures are working with my app but one within a frame. Will try the work around. But please fix this so I can add my gestures with xaml and not code behind.

This case has become a circular reference of Closed cases that cite each other as the true case and themselves been closed.
This bug is still happening and causing issues!

Please re-open this bug and fix the problem. @PureWeen

Was this page helpful?
0 / 5 - 0 ratings