Weird non-tappable dead spots on viewcells in iOS

I'm having this really weird issue where certain parts of view cells in iOS become non-tappable while the rest of the cell does respond to tapping. These "dead spots" vary in size, shape, and location from cell to cell, but usually they are somewhere near the middle of the cell. As far as I can tell the dead spot does not correspond with the bounds of any UI elements. I found that I could get rid of the dead spot by decreasing the cell height to a certain point. But if the height goes past that point then the dead spots come back.

I've tried modifying/removing existing UI elements. I've tried rebuilding the cells from scratch. I've tried using a grid instead of a stacklayout. I'll continue to try more different things but I wanted to know if anyone else has ever run into this strange problem.

See my included xaml:

ViewCell:

<?xml version="1.0" encoding="UTF-8"?>
<ViewCell xmlns="XXX" 
          xmlns:x="XXX"
          x:Class="App.Views.Components.Cells.HorizontalDetailCell"
          IsEnabled="{Binding IsInteractable}">
  <ViewCell.View>
        <StackLayout Orientation="Horizontal" 
                     HorizontalOptions="FillAndExpand"
                     BackgroundColor="{Binding BackgroundColor}">
            <StackLayout Orientation="Horizontal"
                         HorizontalOptions="FillAndExpand"
                         Padding="15,10,15,10">
                <Label Text="{Binding Title}" 
                       LineBreakMode="WordWrap"
                       HorizontalOptions="StartAndExpand"/>
                <Label Text="{Binding Subtitle}" 
                       LineBreakMode="WordWrap" 
                       TextColor="Gray"
                       HorizontalOptions="EndAndExpand"
                       HorizontalTextAlignment="End"/>
            </StackLayout>
            <Image Source="disclosure_indicator" 
                   VerticalOptions="FillAndExpand" 
                   Margin="15,0" 
                   IsVisible="{Binding ShowDisclosureIndicator}"></Image>
        </StackLayout>
    </ViewCell.View>
</ViewCell>

ListView:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="XXX"
             xmlns:x="XXX"
             x:Class="App.Views.HorizontalListViewPage"
             xmlns:local="clr-namespace:App.Views.Components;assembly=App.iOS"
             xmlns:cell="clr-namespace:App.Views.Components.Cells;assembly=App.iOS"
             xmlns:utility="clr-namespace:App.Utility;assembly=App.iOS"
             xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
             utility:ViewModelLocator.AutoWireViewModel="True"
             Title="{Binding Title}"
             ios:Page.UseSafeArea="True">
    <AbsoluteLayout x:Name="absLayout">
        <StackLayout Spacing="0"
                     WidthRequest="{Binding Path=Width, Source={x:Reference absLayout}}"
                     HeightRequest="{Binding Path=Height, Source={x:Reference absLayout}}">
            <local:ResponderListView ItemsSource="{Binding Items}"
                                     HasUnevenRows="True"
                                     BackgroundColor="White"
                                     IsPullToRefreshEnabled="False"
                                     SelectedItem="{Binding SelectedItem, Mode=TwoWay}">
                <ListView.Header>
                    <local:PageHeader BindingContext="{Binding Header}" />
                </ListView.Header>
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <cell:HorizontalDetailCell></cell:HorizontalDetailCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </local:ResponderListView>
        </StackLayout>
        <local:SpinnerView  AbsoluteLayout.LayoutFlags="PositionProportional"
                            AbsoluteLayout.LayoutBounds="0.5,0.5,100,100"
                            IsBusy="{Binding IsBusy}"/>
    </AbsoluteLayout>
</ContentPage>

Best Answer

  • oliver1oliver1 ✭✭
    Accepted Answer

    Figured it out. My spinner view was overlayed on the page, and while it was invisible, it was still blocking taps. I disabled it and everything is working.

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Could it be the image and label are the dead spots? Like they are taking the tap and not passing it down to the cell?

  • oliver1oliver1 Member ✭✭

    @ClintStLaurent said:
    Could it be the image and label are the dead spots? Like they are taking the tap and not passing it down to the cell?

    I don't think so. Because I've actually removed all the labels and images and the dead spot still appeared. Also when the labels and images are there, the dead area does not correspond to the the area that the labels or the image occupy. At least based on what I can see visually. It'd be nice to run this through Xcode's view hierarchy debugger but I'm doing visual studio development on Windows.

  • oliver1oliver1 Member ✭✭
    Accepted Answer

    Figured it out. My spinner view was overlayed on the page, and while it was invisible, it was still blocking taps. I disabled it and everything is working.

Sign In or Register to comment.