[英]Frame Gesture Recognizer doesn't work in ios simulator Xamarin
我正在嘗試制作可點擊的框架。 這是我的代碼:
var tapGestureRecognizer = new TapGestureRecognizer();
tapGestureRecognizer.Tapped += async (s, e) =>
{
await FrameClicked(user, DateTime.Now.Year.ToString());
};
currentseasonbutton.GestureRecognizers.Add(tapGestureRecognizer);
XAML:
<Frame Grid.Column="0" HasShadow="True" CornerRadius="10" Padding="0" HeightRequest="120" VerticalOptions="Start" x:Name="currentseasonbutton">
<StackLayout Orientation="Vertical" Spacing="10" HorizontalOptions="CenterAndExpand">
<Image Source="bookingicon.png" HeightRequest="30" HorizontalOptions="Center" Margin="0,20,0,0"/>
<StackLayout Spacing="7" HorizontalOptions="CenterAndExpand">
<Label Text="Booking List" TextColor="Black" FontSize="14" FontAttributes="Bold" HorizontalOptions="Center"/>
<Label x:Name="currentSeason" TextColor="#7D7D7D" FontSize="11" HorizontalOptions="Center"/>
</StackLayout>
</StackLayout>
</Frame>
它適用於Android模擬器,但不適用於IOS模擬器。 可能是什么原因?
同樣在這里。
似乎 iOS 13.4 Simulator GestureRecognizers 根本不起作用。
但是使用帶有 iOS 12.1 的舊模擬器 GestureRecognizers 只在某些時候工作,而不是在所有對象上,但在真正的 iOS 中所有工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.