xamarin - 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");
}
解决方案
我在 xamarin.forms 4.5.0.617 之前解决了它更新到 mac 端的 beta IOS SDK 更新。
现在这个问题已经修复,您可以将 Xamrin Forms 更新到最新版本 4.5.0.617,然后它将在 iOS 13.4 中运行。
谢谢姜小哥
推荐阅读
- java - Java ActionPerformed() 方法不执行
- javascript - 使用 apollo-express 限制或过滤 graphql 查询
- pandas - Pandas 在 Dataframe 中检查 False 值
- javascript - 使用 Babel 插件将 JSX 属性转换为函数调用
- python - 如何在新类中实例化对象?
- haskell - Haskell:将参数组合成元组而不是使用不同的参数有什么含义?
- r - R:dplyr 有条件地汇总并重新编码列中的值
- python - 如何将文本文件放在 tkinter 条目上
- r - 过滤R列表
- java - 如何使用旧的休眠标准进行批处理?