【问题标题】:Page having a horizontal list view, and displaying that list data in the Screen Xamarin Forms具有水平列表视图并在屏幕 Xamarin 表单中显示该列表数据的页面
【发布时间】:2017-08-29 07:47:39
【问题描述】:

我有一个页面,现在我想做的是在列表视图中进行水平滚动。列表视图包含一个进度条、一个 Image 和一个 Label。 在列表视图中选择任何项目后,它将在剩余屏幕上显示结果。我怎样才能做到这一点?

【问题讨论】:

    标签: listview xamarin cross-platform


    【解决方案1】:

    将 Rotation 设置为 270(所有 VisualElements 都有一个 Rotation BindableProperty)。但是,这看起来不是最佳解决方案,因为顶部和底部都有空白,您必须左右拖动视图才能完整查看所有内容。

    <ListView x:Name="ListView" Rotation="270" ItemsSource="{Binding Items}" RowHeight="40">
      <ListView.ItemTemplate>
        <DataTemplate>
          <ViewCell>
            <ViewCell.View>
              <StackLayout>
                <!--your layout go there-->
              </StackLayout>
            </ViewCell.View>
          </ViewCell>
        </DataTemplate>
      </ListView.ItemTemplate>
    </ListView>
    

    【讨论】:

    • 我只使用这个,但我的布局出错了。我想要一个顶部的文本视图,然后是一个图像,然后是一个进度条。但是当我启用水平滚动时,每行的大小非常小,并且布局不正确。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-01-12
    • 1970-01-01
    • 2019-02-10
    • 1970-01-01
    • 2020-10-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多