相关疑难解决方法(0)

减少Xaml中Listview中的底部和顶部空间(UWP-Universal Windows平台)

我正在为windows-10开发通用Windows平台应用程序.我有关于listview的问题.当我点击并悬停在listview项目上时,所选区域背景很大.你可以在我的图片中看到.

码:

<ListView  Height="160" Name="lstconfig_option" BorderThickness="0"   BorderBrush="#FFB0B7BE" ItemClick="lstconfig_option_ItemClick" IsItemClickEnabled="True"   HorizontalAlignment="Stretch">
                                    <ListView.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <WrapGrid Orientation="Horizontal" MaximumRowsOrColumns="10"/>
                                        </ItemsPanelTemplate>
                                    </ListView.ItemsPanel>
                                    <ListView.ItemContainerStyle>
                                        <Style TargetType="ListViewItem">
                                            <Setter Property="HorizontalContentAlignment" Value="Left" />
                                            <Setter Property="VerticalContentAlignment" Value="Center" />
                                            <Setter Property="Margin" Value="0,0,0,0" />
                                            <Setter Property="Padding" Value="0,0,0,-6" />
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="ListViewItem">
                                                        <ListViewItemPresenter          
                                  PointerOverBackground="{ThemeResource SystemControlHighlightListLowBrush}"       
                                  SelectedBackground="{ThemeResource SystemControlHighlightListMediumBrush}"      
                                  SelectedPointerOverBackground="{ThemeResource SystemControlHighlightListMediumBrush}"
                                 PressedBackground="{ThemeResource SystemControlHighlightListMediumBrush}"
                                 SelectedPressedBackground="{ThemeResource SystemControlHighlightListMediumBrush}" />
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>


                                        </Style>
                                    </ListView.ItemContainerStyle>

                                    <ListView.ItemTemplate>
                                        <DataTemplate >
                                            <StackPanel Grid.Row="1" Height="auto" HorizontalAlignment="Stretch" PointerEntered="btnFilter_PointerEntered" PointerExited="btnFilter_PointerExited" ToolTipService.ToolTip="{Binding tooltip_text}" ToolTipService.Placement="Bottom">
                                                <Grid Height="auto">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="*"></ColumnDefinition>
                                                        <ColumnDefinition Width="auto"></ColumnDefinition>
                                                    </Grid.ColumnDefinitions>

                                                    <StackPanel Grid.Column="0" …
Run Code Online (Sandbox Code Playgroud)

windows xaml universal uwp

0
推荐指数
1
解决办法
1118
查看次数

标签 统计

universal ×1

uwp ×1

windows ×1

xaml ×1