首页 > 解决方案 > why click events or gestures are not work in carousel page childs on IOS?

问题描述

Im trying to click Image,box or label object which in Carousel views content page. Android works fine but IOS not, why? Can you help or explain?

Here is simple demo:

<CarouselPage xmlns="http://xamarin.com/schemas/2014/forms" 
          xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
          x:Class="CarouselPageNavigation.MainPage">
<ContentPage>
    <ContentPage.Padding>
        <OnPlatform x:TypeArguments="Thickness">
            <On Platform="iOS, Android" Value="0,40,0,0" />
        </OnPlatform>
    </ContentPage.Padding>
    <StackLayout>
        <Label Text="Green" FontSize="Medium" HorizontalOptions="Center" />
        <BoxView Color="Green" WidthRequest="200" HeightRequest="200" HorizontalOptions="Center" VerticalOptions="CenterAndExpand">
            <BoxView.GestureRecognizers>
                <TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"></TapGestureRecognizer>
            </BoxView.GestureRecognizers>
        </BoxView>
    </StackLayout>
</ContentPage>

Here is .cs

        private void TapGestureRecognizer_Tapped(object sender, System.EventArgs e)
    {
        DisplayAlert("sdada", "sdada", "sdadada");
    }

标签: xamarinxamarin.formsxamarin.ios

解决方案


我在 xamarin.forms 4.5.0.617 之前解决了它更新到 mac 端的 beta IOS SDK 更新。

现在这个问题已经修复,您可以将 Xamrin Forms 更新到最新版本 4.5.0.617,然后它将在 iOS 13.4 中运行。

谢谢姜小哥


推荐阅读