GridView / ListView内容方向问题 [英] GridView/ListView content orientation problems

查看:65
本文介绍了GridView / ListView内容方向问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

解决方案

Hi Tiemen,


这是你需要的吗? / p>


I有这样的xaml代码,修改基于示例:
https://code.msdn.microsoft Scenaio 2,您可能需要进一步自定义它:

< GridView x:Name =" ItemsByLetter" .com / windowsapps / GroupedGridView-77c59e8e  VerticalAlignment = QUOT;底座" 
Width =" 1200"
高度="500"
ScrollViewer.Horizo​​ntalScrollBarVisibility =" Visible"
ScrollViewer.Horizo​​ntalScrollMode ="已启用"
ScrollViewer.VerticalScrollBarVisibility =" Visible"
ScrollViewer.VerticalScrollMode ="已启用"
ItemsSource =" {Binding Source = {StaticResource cvs2}}"
ShowsScrollingPlaceholders =" False"
ContainerContentChanging =" ItemsByLetter_ContainerContentChanging"
BorderBrush =" {StaticResource ApplicationForegroundThemeBrush}"了borderThickness = QUOT 1 QUOT;>

< GridView.ItemsPanel>
< ItemsPanelTemplate>
< ItemsWrapGrid Width =" 2000" GroupHeaderPlacement = QUOT;陀螺"取向= QUOT;水平" />
< / ItemsPanelTemplate>
< /GridView.ItemsPanel>
< GridView.ItemTemplate>
< DataTemplate>
< local:ItemViewer />
< / DataTemplate>
< /GridView.ItemTemplate>

< GridView.GroupStyle>
< GroupStyle>
< GroupStyle.HeaderTemplate>
< DataTemplate>
< Grid Background =" {StaticResource ApplicationPageBackgroundThemeBrush}"余量= QUOT; 10">
< TextBlock Text ='{Binding Key}'Foreground =" {StaticResource ApplicationForegroundThemeBrush}"字号= QUOT; 25"余量= QUOT; 5英寸/>
< / Grid>
< / DataTemplate>
< /GroupStyle.HeaderTemplate>
< / GroupStyle>
< /GridView.GroupStyle>
< / GridView>


--James



Hello there,

解决方案

Hi Tiemen,

Is this what you need?

I have the xaml code like this, modified base on the sample: https://code.msdn.microsoft.com/windowsapps/GroupedGridView-77c59e8e Scenaio 2, you may need further customize it:

  <GridView x:Name="ItemsByLetter"  VerticalAlignment="Bottom" 
                      Width="1200"
                      Height="500"
                      ScrollViewer.HorizontalScrollBarVisibility="Visible"
                      ScrollViewer.HorizontalScrollMode="Enabled"
                      ScrollViewer.VerticalScrollBarVisibility="Visible"
                      ScrollViewer.VerticalScrollMode="Enabled"
                      ItemsSource="{Binding Source={StaticResource cvs2}}"
                      ShowsScrollingPlaceholders="False"
                      ContainerContentChanging="ItemsByLetter_ContainerContentChanging"
                      BorderBrush="{StaticResource ApplicationForegroundThemeBrush}" BorderThickness="1">

                <GridView.ItemsPanel>
                    <ItemsPanelTemplate>
                        <ItemsWrapGrid Width="2000" GroupHeaderPlacement="Top" Orientation="Horizontal"/>
                    </ItemsPanelTemplate>
                </GridView.ItemsPanel>
                <GridView.ItemTemplate>
                    <DataTemplate>
                        <local:ItemViewer/>
                    </DataTemplate>
                </GridView.ItemTemplate>

                <GridView.GroupStyle>
                    <GroupStyle>
                        <GroupStyle.HeaderTemplate>
                            <DataTemplate>
                                <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}" Margin="10">
                                    <TextBlock Text='{Binding Key}' Foreground="{StaticResource ApplicationForegroundThemeBrush}" FontSize="25" Margin="5" />
                                </Grid>
                            </DataTemplate>
                        </GroupStyle.HeaderTemplate>
                    </GroupStyle>
                </GridView.GroupStyle>
            </GridView>

--James


这篇关于GridView / ListView内容方向问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆