首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Syncfusion Xamarin ListView,右键扫描问题

问Syncfusion Xamarin ListView,右键扫描问题
EN

Stack Overflow用户
提问于 2020-03-03 01:36:28
回答 1查看 214关注 0票数 0

我能请求一点帮助吗?

我使用了一个SfListView控件,ListView可以工作,但是右击不起作用。我读了Syncfusion网站上的文档,但我找不到解决方案。

感谢你的回答!

代码语言:javascript
复制
        <sflistview:SfListView Grid.Row="1" Grid.Column="0" BackgroundColor="{StaticResource greybackground}" ItemSpacing="15"  Orientation="Vertical" ItemsSource="{Binding Applications}" AllowSwiping="True" SelectionMode="Single" >
      <sflistview:SfListView.RightSwipeTemplate>
        <DataTemplate>
          <Grid>
            <Grid BackgroundColor="Red" HorizontalOptions="Fill" VerticalOptions="Fill" Grid.Column="0">
              <Grid VerticalOptions="Center" HorizontalOptions="Center">
                <Image Grid.Column="0"
                       Grid.Row="0"
                       BackgroundColor="Transparent"
                       HeightRequest="50"
                       WidthRequest="50"
                       Source="animalsafety.png"/>
              </Grid>
            </Grid>
          </Grid>
        </DataTemplate>
      </sflistview:SfListView.RightSwipeTemplate>
      <sflistview:SfListView.ItemTemplate>
        <DataTemplate>
          <Grid >
            <Grid.RowDefinitions>
              <RowDefinition Height="50*"/>
              <RowDefinition Height="50*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="2*"/>
              <ColumnDefinition Width="24*"/>
              <ColumnDefinition Width="92*"/>
              <ColumnDefinition Width="33*"/>
            </Grid.ColumnDefinitions>
            <Label BackgroundColor="Orange" Grid.Row="0" Grid.RowSpan="2" Grid.Column="0"/>
            <border:SfBorder Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" HorizontalOptions="Center" VerticalOptions="Center" BorderColor="Transparent" CornerRadius="30" BackgroundColor="{StaticResource headercolor}">
              <Image Source="{Binding IJob.CategoryImageWhite}"  VerticalOptions="Center" HorizontalOptions="Center" BackgroundColor="{StaticResource headercolor}"/>
            </border:SfBorder>

              <Label Grid.Row="0" Grid.Column="2" Text="{Binding IJob.Company}"  HorizontalTextAlignment="Center" FontSize="Medium" Margin="0" VerticalOptions="Center"/>
              <Label Grid.Row="1" Grid.Column="2" Text="{Binding IJob.Job}"  HorizontalTextAlignment="Center" FontSize="Medium" Margin="0" VerticalOptions="Center"/>

            <border:SfBorder Grid.Row="0" Grid.RowSpan="2" Grid.Column="3" BackgroundColor="{Binding StatusColor}" CornerRadius="30" BorderColor="Transparent">
              <Button BackgroundColor="{Binding StatusColor}"  HorizontalOptions="Center" Command="{Binding ICommandJobStatus}" Clicked="JobStatusClicked" CommandParameter="{Binding .}" VerticalOptions="Center"/>
            </border:SfBorder>
          </Grid>
        </DataTemplate>
      </sflistview:SfListView.ItemTemplate>

    </sflistview:SfListView>
EN

回答 1

Stack Overflow用户

发布于 2020-03-05 16:50:30

如果您在SfListView中对按钮或任何其他交互控件执行滑动操作,则触摸将由交互控件本身处理,而不会滑动ListView。为了在交互控件上执行滑动操作,我们建议您像下面的代码片段那样设置InputTransparent=”True”。

代码语言:javascript
复制
<Button BackgroundColor="{Binding StatusColor}"  HorizontalOptions="Center" 
        Command="{Binding ICommandJobStatus}" Clicked="JobStatusClicked" 
        CommandParameter="{Binding .}" VerticalOptions="Center"
        InputTransparent="True"/>

以下视频样本供您参考:

视频链接:Video

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60493938

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档