UWP:CornerRadius对GridViewItem没有影响
我正在尝试使一个UWP:CornerRadius对GridViewItem没有影响,uwp,uwp-xaml,Uwp,Uwp Xaml,我正在尝试使一个GridViewItem有一个White背景和一张卡片一样的角落 我尝试使用以下代码,但是CornerRadius根本不起作用 <Style x:Key="BasicGridViewWithBackground" TargetType="GridView"> <Setter Property="ItemContainerStyle"> <Setter
GridViewItem
有一个White
背景和一张卡片一样的角落
我尝试使用以下代码,但是CornerRadius
根本不起作用
<Style x:Key="BasicGridViewWithBackground" TargetType="GridView">
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="GridViewItem">
<Setter Property="CornerRadius" Value="5"/>
<Setter Property="Background" Value="White"/>
<Setter Property="Margin" Value="0,0,20,20"/>
<Setter Property="Width" Value="160"/>
<Setter Property="Height" Value="90"/>
</Style>
</Setter.Value>
</Setter>
</Style>
无论我在
或
中添加
,项目始终是一个没有角的矩形
我该怎么办?通常,如果需要更改角点,我们将直接更改UIelement.CornerRadius属性。你能分享一下你正在使用的GridView的代码片段吗?您是否为其创建了项目模板?如果是,您可以只更改项目中根控件的CornerRadius属性。