0
我試圖將TapGestureRecognizer
添加到Label
。標籤TapGesture不啓動Xamarin表單
SliderAbout.GestureRecognizers.Add(new TapGestureRecognizer
{
Command = new Command(() => OpenAboutAppAsync()),
});
SliderAbout是我Label
至極是在XAML中設置和正常工作。
<ScrollView Grid.Row="1">
<Grid VerticalOptions="Start" HorizontalOptions="Start" Margin="20,20,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
</Grid.RowDefinitions>
<Label x:Name="SliderAbout"
Text="Über die APP"
Grid.Row="2"
TextColor="White"
FontFamily="Open Sans Light"
FontSize="Medium"/>
</Grid>
</ScrollView>
的代碼也被運行(我把它放在類的構造函數)
但是當我點擊該標籤法犯規火...爲什麼它不會火?
感謝您的幫助!
請出示您的佈局。該標籤是否可能位於另一個元素之下? –
添加xaml代碼 – Cambaru
將gesturerecognizer添加到網格,或者在網格上嘗試'InputTransparent =「true」' –