【问题标题】:Adpative Listview to adjust according to screen size for UWP xaml app自适应列表视图根据 UWP xaml 应用程序的屏幕大小进行调整
【发布时间】:2018-11-15 15:58:01
【问题描述】:

Listview 内容多个项目,如文本块 我们如何使其列表视图根据网格包含多个列表视图框的屏幕分辨率自适应。 需要根据屏幕变化调整下面类似的xaml页面列表项和文本

【问题讨论】:

  • 您是否从社区工具中检查了AdaptiveGridView
  • 你的 XAML/你尝试了什么?

标签: xaml uwp adaptive-ui


【解决方案1】:

根据您的要求,您可以使用WrapPanel Xaml Control 来接近。您只需将默认 ListView ItemsPanelTemplate 替换为 WrapPanel。更详细的可以参考下面的代码。

<ListView Name="WrapPanelContainer"
          IsItemClickEnabled="True"
          ItemTemplate="{StaticResource PhotoTemplate}">
  <ItemsControl.ItemsPanel>
    <ItemsPanelTemplate>
      <controls:WrapPanel Background="{ThemeResource Brush-Grey-04}"
                          Padding="0,0,0,0"
                          VerticalSpacing="5"
                          HorizontalSpacing="5" />
    </ItemsPanelTemplate>
  </ItemsControl.ItemsPanel>
</ListView>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-03
    • 2011-02-03
    • 1970-01-01
    • 2013-11-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多