Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug][iOS] TapGesture in Shell does not work in iOS(Xamarin.Forms). #12785

Closed
GnanaPriyaNamasivayam opened this issue Nov 9, 2020 · 5 comments · Fixed by #12967
Closed

[Bug][iOS] TapGesture in Shell does not work in iOS(Xamarin.Forms). #12785

GnanaPriyaNamasivayam opened this issue Nov 9, 2020 · 5 comments · Fixed by #12967

Comments

@GnanaPriyaNamasivayam
Copy link

Description

Added TapGesture for View loaded inside Shell.ItemTemplate. Its not working only on iOS 14.1. Last checked iOS version 13.3 worked fine and also Android too works properly.

My app's Xamarin Forms : v4.7.0.1179

Steps to Reproduce

  1. Added Xaml for reference view.
  2. Use them and hook viewmodel command for one of the Item (LogOut- one of template selector item)loaded inside Shell.ItemTemplate.
  3. ViewModel command does not fire for 14.1.

Expected Behavior

Gesture's ViewModel command should fire in iOS 14.1 version.

Actual Behavior

Gesture's ViewModel command not firing in iOS 14.1 version.

Basic Information

  • Version with issue: iOS 14.1 and My Xamarin Forms version : 4.7.0.1179
  • Last known good version: iOS 13.3 (At that also used same Xamarin Forms vesion)
  • IDE:
  • Platform Target Frameworks:
    • iOS: 14.1 and please find below iOS platform details for your reference.
      === Visual Studio Community 2019 for Mac ===

Version 8.7.9 (build 9)
Installation UUID: 4016c3dc-d19e-4ab2-aac0-b84d621a8566
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

Package version: 612000093

=== Mono Framework MDK ===

Runtime:
Mono 6.12.0.93 (2020-02/620cf538206) (64-bit)
Package version: 612000093

=== Roslyn (Language Service) ===

3.7.0-6.20427.1+18ede13943b0bfae1b44ef078b2f3923159bcd32

=== Xamarin Designer ===

Version: 16.7.0.495
Hash: 03d50a221
Branch: remotes/origin/d16-7-vsmac
Build date: 2020-08-28 13:12:52 UTC

=== NuGet ===

Version: 5.7.0.6702

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.1.403/Sdks
SDK Versions:
3.1.403
3.1.200
3.1.101
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.1.9
3.1.2
3.1.1
2.1.23
2.1.17
2.1.16
2.1.15

=== Xamarin.Profiler ===

Version: 1.6.13.11
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 12.1 (17222)
Build 12A7403

=== Xamarin.Android ===

Version: 11.0.2.0 (Visual Studio Community)
Commit: xamarin-android/d16-7/025fde9
Android SDK: /Users/macmini1/Library/Android/sdk
Supported Android versions:
6.0 (API level 23)
8.0 (API level 26)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.5
SDK Build Tools Version: 29.0.2

Build Information:
Mono: 83105ba
Java.Interop: xamarin/java.interop/d16-7@1f3388a
ProGuard: Guardsquare/proguard@ebe9000
SQLite: xamarin/sqlite@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-7@017078f

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/macmini1/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.7.0.13
Hash: 8380518
Branch: remotes/origin/d16-7~2
Build date: 2020-09-16 05:12:24 UTC

=== Android Device Manager ===

Version: 16.7.0.24
Hash: bb090a3
Branch: remotes/origin/d16-7
Build date: 2020-09-16 05:12:46 UTC

=== Xamarin.Mac ===

Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

=== Xamarin.iOS ===

Version: 14.2.0.12 (Visual Studio Community)
Hash: e0ce49680
Branch: xcode12.1
Build date: 2020-10-20 09:52:06-0400

=== Build Information ===

Release ID: 807090009
Git revision: d29d54665a1fc79986687a540a7a4676f97ad3da
Build date: 2020-10-21 15:05:18-04
Build branch: release-8.7
Xamarin extensions: d29d54665a1fc79986687a540a7a4676f97ad3da

=== Operating System ===

Mac OS X 10.15.7
Darwin 19.6.0 Darwin Kernel Version 19.6.0
Mon Aug 31 22:12:52 PDT 2020
root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64

  • Nuget Packages:
  • Affected Devices: IOS 14.1

Screenshots - Sample view

image

Reproduction Link

<controls:ShellExtended x:Class="Alden.One.Client.Dashboard.Views.DashboardPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:Alden.One.Client.Common.Presentation.Controls;assembly=Alden.One.Client.Common.Presentation"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:iOsSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="clr-namespace:Alden.One.Client.Dashboard.Views;assembly=Alden.One.Client.Dashboard.Views"
x:Name="ShellExtended"
Title="Dashboard"
iOsSpecific:Page.UseSafeArea="true"
BackgroundColor="#4B5B51"
DetailItems="{Binding DetailItemsList}"
FlyoutBackgroundColor="{StaticResource White}"
mc:Ignorable="d">

<controls:ShellExtended.Resources>
    <ResourceDictionary>

        <Style TargetType="Grid">
            <Setter Property="RowSpacing" Value="0" />
            <Setter Property="ColumnSpacing" Value="0" />

        </Style>

        <Style x:Key="FormDivider" TargetType="BoxView">
            <Setter Property="HeightRequest" Value="0.4" />
            <Setter Property="HorizontalOptions" Value="FillAndExpand" />
            <Setter Property="Color" Value="Gray" />
        </Style>

        <DataTemplate x:Key="LogoutTemplate">
            <StackLayout >
                <Grid Margin="0,10">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.2*" />
                        <ColumnDefinition Width="0.8*" />
                    </Grid.ColumnDefinitions>
                    <Image Margin="10"
                       Aspect="AspectFit"
                       Source="menu_logout.png" />
                    <Label Grid.Column="1"
                       FontSize="Medium"
                       LineBreakMode="WordWrap"
                       MaxLines="1"
                       Text="{Binding Title}"
                       TextColor="{StaticResource AccentColor}"
                       VerticalTextAlignment="Center" />

                </Grid>
                <BoxView HeightRequest="5"/>
                <StackLayout.GestureRecognizers>
                    <TapGestureRecognizer Command="{Binding Source={x:Reference ShellExtended}, Path=BindingContext.LogoutCommand}" Tapped="TapGestureRecognizer_OnTapped" />
                </StackLayout.GestureRecognizers>
            </StackLayout>


        </DataTemplate>

        <DataTemplate x:Key="SelectableItemTemplate">
            <StackLayout>
                <Grid Margin="0,10">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.2*" />
                        <ColumnDefinition Width="0.5*" />
                        <ColumnDefinition Width="0.3*" />
                    </Grid.ColumnDefinitions>

                    <Image Margin="10" Source="{Binding FlyoutIcon}" />

                    <Label Grid.Column="1"
                       FontSize="Medium"
                       Text="{Binding Title}"
                       TextColor="{StaticResource AccentColor}"
                       VerticalTextAlignment="Center" />

                    <Switch Grid.Column="2" IsToggled="{Binding Source={x:Reference ShellExtended}, Path=BindingContext.IsOffline}" />
                    <Grid.GestureRecognizers>
                        <TapGestureRecognizer Command="{Binding Source={x:Reference ShellExtended}, Path=BindingContext.GoOfflineCommand}" Tapped="TapGestureRecognizer_OnTapped" />
                    </Grid.GestureRecognizers>

                </Grid>
                <BoxView HeightRequest="5" />

            </StackLayout>
        </DataTemplate>


        <DataTemplate x:Key="OtherTemplate">
            <StackLayout>
                <Grid Margin="0,10">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.2*" />
                    <ColumnDefinition Width="0.8*" />
                </Grid.ColumnDefinitions>
                <Image Margin="10" Source="{Binding FlyoutIcon}" />
                <Label Grid.Column="1"
                       FontSize="Medium"
                       Text="{Binding Title}"
                       TextColor="{StaticResource AccentColor}"
                       VerticalTextAlignment="Center" />
            </Grid>
                <BoxView HeightRequest="5" />

            </StackLayout>
        </DataTemplate>

    </ResourceDictionary>
</controls:ShellExtended.Resources>

<controls:ShellExtended.ItemTemplate>
    <views:FlyOutItemTemplateSelector LogOutFeatureTileTemplate="{StaticResource LogoutTemplate}"
                                      OtherTileTemplate="{StaticResource OtherTemplate}"
                                      SelectableFeatureTileTemplate="{StaticResource SelectableItemTemplate}" />
</controls:ShellExtended.ItemTemplate>

<controls:ShellExtended.FlyoutHeader>
    <Grid Margin="0,10"
          BackgroundColor="{StaticResource White}"
          HeightRequest="75"
          VerticalOptions="CenterAndExpand">

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="25*" />
            <ColumnDefinition Width="75*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Image Grid.Row="0"
               Grid.RowSpan="2"
               Grid.Column="0"
               Margin="10"
               Source="menu_profile.png" />

        <Label Grid.Row="0"
               Grid.Column="1"
               FontSize="Small"
               MaxLines="1"
               Text="{Binding UserName}"
               TextColor="{StaticResource AccentColor}"
               VerticalOptions="EndAndExpand"
               VerticalTextAlignment="Center" />

        <Label Grid.Row="1"
               Grid.Column="1"
               FontSize="Small"
               MaxLines="1"
               Text="{Binding Email}"
               TextColor="{StaticResource AccentColor}"
               VerticalOptions="StartAndExpand"
               VerticalTextAlignment="Center" />

    </Grid>
</controls:ShellExtended.FlyoutHeader>

<!--  Adding a blank page to cheat the shell core since it checks for default added item we are handling it in the extended shell element :-)  -->
<ContentPage />

</controls:ShellExtended>

Workaround

No .

@GnanaPriyaNamasivayam GnanaPriyaNamasivayam added s/unverified New report that has yet to be verified t/bug 🐛 labels Nov 9, 2020
@samhouts samhouts added this to New in Triage Nov 9, 2020
@rachelkang
Copy link
Contributor

Hi, @GnanaPriyaNamasivayam - thanks for submitting this issue! Unfortunately, I wasn't able to reproduce it :/
Would you mind sharing either this project or a smaller sample project that reproduces the same issue? Thank you :)

@rachelkang rachelkang added s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Nov 9, 2020
@rachelkang rachelkang moved this from New to Needs Info in Triage Nov 9, 2020
@GnanaPriyaNamasivayam
Copy link
Author

GnanaPriyaNamasivayam commented Nov 9, 2020

Hi @rachelkang , Hope this helps.
Uploading ShellSample.zip…

I tried to replicate in documentation sample. You can also use my project xaml in above sample to confirm. Please ensure in iOS 14.0

@Redth Redth removed s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Nov 10, 2020
@Redth Redth moved this from Needs Info to New in Triage Nov 17, 2020
@jsuarezruiz
Copy link
Contributor

@GnanaPriyaNamasivayam Sorry, it seems that the attached example was not uploaded correctly last time, could you upload it again?

@jsuarezruiz jsuarezruiz moved this from New to Needs Info in Triage Nov 18, 2020
@jsuarezruiz jsuarezruiz added the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Nov 18, 2020
@GnanaPriyaNamasivayam
Copy link
Author

GnanaPriyaNamasivayam commented Nov 18, 2020

@jsuarezruiz / @rachelkang Uploaded sample link : https://easyupload.io/e57utm

If still not replicated in your side then you can use above xaml template in your shell sample.

@Redth Redth removed the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Nov 30, 2020
@Redth Redth moved this from Needs Info to New in Triage Dec 1, 2020
@PureWeen
Copy link
Contributor

PureWeen commented Dec 7, 2020

This should be fixed by this PR

#12967

@PureWeen PureWeen removed the s/unverified New report that has yet to be verified label Dec 7, 2020
@PureWeen PureWeen moved this from New to Ready For Work in Triage Dec 7, 2020
@Redth Redth moved this from Ready For Work to Needs Estimate in Triage Dec 15, 2020
Triage automation moved this from Needs Estimate to Closed Dec 18, 2020
rmarinho pushed a commit that referenced this issue Dec 18, 2020
…out items not updating layout (#12967) fixes #12429 fixes #12785

* Fixed extra height and added sample page

* - fix some dynamic layouts

* - fix android to resize

* - get rid of cell reuse, allow buttons inside template, let cells resize dynamically

* - Add UITests
- Fix Android Measuring

* - remove comments

* - fix UWP Measuring

* - Fix Automation Id to use Bindings on uwp

* - fix language and iOS test

* - cleanup

* - fix iOS margin issue

* - fix iOS type

Co-authored-by: shane <shneuvil@microsoft.com>
Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Triage
  
Closed
5 participants