|
1 | 1 | # How to handle the tapped Xamarin.Forms listview tapped event when child view is clicked in Android platform? |
2 | 2 | This example demonstrates how to handle the interaction event for the child view in Android Renderer. |
3 | 3 |
|
| 4 | +## Sample |
| 5 | + |
| 6 | +```xaml |
| 7 | + <sync:SfListView x:Name="listView" ItemSize="120" TapCommand="{Binding TapCommand}" |
| 8 | + ItemsSource="{Binding BookInfo}"> |
| 9 | + <sync:SfListView.Behaviors> |
| 10 | + <local1:Behaviours/> |
| 11 | + </sync:SfListView.Behaviors> |
| 12 | + <sync:SfListView.ItemTemplate> |
| 13 | + <DataTemplate> |
| 14 | + <Grid Padding="10" BackgroundColor="Aqua"> |
| 15 | + <Grid.GestureRecognizers> |
| 16 | + <TapGestureRecognizer Command="{Binding Path = BindingContext.GestureCommand, Source={x:Reference listView}}"/> |
| 17 | + </Grid.GestureRecognizers> |
| 18 | + <Grid.ColumnDefinitions> |
| 19 | + <ColumnDefinition Width="*" /> |
| 20 | + <ColumnDefinition Width="100" /> |
| 21 | + </Grid.ColumnDefinitions> |
| 22 | + <Grid.RowDefinitions> |
| 23 | + <RowDefinition Height="0.4*" /> |
| 24 | + <RowDefinition Height="0.6*" /> |
| 25 | + </Grid.RowDefinitions> |
| 26 | + <Label Text="{Binding BookName}" FontAttributes="Bold"/> |
| 27 | + <Button Text="Test" Command="{Binding BindingContext.ButtonCommand, Source={x:Reference listView}}" Grid.Row="1"/> |
| 28 | + <!--<Label Grid.Row="1" Text="{Binding BookDescription}" FontSize="15"/>--> |
| 29 | + <!--<numeric:SfNumericUpDown Grid.Column="1" Grid.RowSpan="2" HorizontalOptions="Start" VerticalOptions="Center"/>--> |
| 30 | + </Grid> |
| 31 | + </DataTemplate> |
| 32 | + </sync:SfListView.ItemTemplate> |
| 33 | +</sync:SfListView> |
| 34 | +``` |
| 35 | + |
4 | 36 | See [How to handle the tapped event when child view is clicked in Android platform](https://www.syncfusion.com/kb/9536/how-to-handle-the-tapped-event-when-child-view-is-clicked-in-android-platform) for more details. |
5 | 37 | ## <a name="requirements-to-run-the-demo"></a>Requirements to run the demo ## |
6 | 38 |
|
|
0 commit comments