1

私はUWPプラットフォームの初心者です。テンプレート10を使用してアプリケーションを構築しています。特定のページにGridViewを使用しましたが、問題はその上にカーソルを置くかその項目を選択すると、GridViewの罫線が表示されます。このように:テンプレート10:ハンバーガーナビゲーションで新しいボタンを宣言し、そのページにナビゲートする

The Grideview Image

私は、ユーザーがそれの上に置いたりGridView項目を選択するたびに境界線が現れないようにしたいです。

私のXAMLコードは次のとおりです。

<Page 
x:Class="Sample.Views.Category" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:local="using:Sample.Views" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
xmlns:data="using:Sample.ViewModels" 
xmlns:controls="using:Template10.Controls" 
mc:Ignorable="d"> 
<Page.Resources> 
    <DataTemplate x:DataType="data:CategoryViewModel" x:Key="CategoryDataTemplate"> 
     <StackPanel HorizontalAlignment="Center" Margin="10,0,20,10"> 

      <Image Width="150" Source="{x:Bind IconFile}" /> 
      <TextBlock FontSize="16" Text="{x:Bind Category}" HorizontalAlignment="Center" /> 
      <!--<TextBlock FontSize="10" Text="{x:Bind Author}" HorizontalAlignment="Center" />--> 
     </StackPanel> 
    </DataTemplate> 
</Page.Resources> 
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> 

    <Grid.RowDefinitions> 
     <RowDefinition Height="Auto"/> 
     <RowDefinition Height="*"/> 
    </Grid.RowDefinitions> 

    <!-- header --> 
    <controls:PageHeader x:Name="pageHeader" Frame="{x:Bind Frame}" Text="Category Page" Grid.Row="0" Grid.ColumnSpan="2"> 
     <!-- place stretched, across top --> 
     <RelativePanel.AlignTopWithPanel>True</RelativePanel.AlignTopWithPanel> 
     <RelativePanel.AlignRightWithPanel>True</RelativePanel.AlignRightWithPanel> 
     <RelativePanel.AlignLeftWithPanel>True</RelativePanel.AlignLeftWithPanel> 
    </controls:PageHeader> 

    <GridView Grid.Row="2" > 
     <GridView ItemsSource="{x:Bind Categories}" 
       IsItemClickEnabled="True" 
       ItemClick="GridView_ItemClick" 
       ItemTemplate="{StaticResource CategoryDataTemplate}" > 
     </GridView> 
    </GridView> 
</Grid> 

答えて

0

は(厚みが機能しなかったと仮定した場合)0にGridViewのBorderThicknessを設定してみてください、そして透明にブラシ

https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.gridview.aspx

次に、XAMLのgridviewコントロールのプロパティへのリンクを示します。

あなたは初心者だから、さまざまなプロパティを使いこなしてみてください。グリッドビュー内にネストされたグリッドビューがあるので、両方のグリッドビューにグリッドビューを設定してみてください。運のベスト

<GridView> 
    <GridView.ItemContainerStyle> 
     <Style TargetType="GridViewItem"> 
      <Setter Property="Margin" Value="0,0,4,4" /> 
      <Setter Property="Background" Value="Transparent"/> 
      <Setter Property="TabNavigation" Value="Local"/> 
      <Setter Property="IsHoldingEnabled" Value="True"/> 
      <Setter Property="Template"> 
       <Setter.Value> 
        <ControlTemplate TargetType="GridViewItem"> 
         <ContentPresenter /> 
        </ControlTemplate> 
       </Setter.Value> 
      </Setter> 
     </Style> 
    </GridView.ItemContainerStyle> 
</GridView> 

例えば:

<GridView Grid.Row="2" BorderThickness="0"> 
1

これは、ここにテンプレート10の問題ではありませんが、その答えです。

+0

ありがとうございます!@ジェリー – Uwpbeginner

関連する問題