【问题标题】:ListView with rounded corners带圆角的 ListView
【发布时间】:2012-07-11 15:51:35
【问题描述】:

我想对 ListView 进行圆角处理。我曾尝试使用Template 属性,但似乎我必须重写整个模板。有什么方法可以到达边界以便我可以设置CornerRadius

【问题讨论】:

  • 只有一条评论。你尝试过风格吗?
  • @Blam 有点,因为我考虑过,但不知道在这种情况下如何使用它
  • 这也可能有帮助:[1]:stackoverflow.com/questions/16757296/…

标签: c# .net wpf


【解决方案1】:

忽略 BorderThickness 和 CornerRadius 的值,您可以根据自己的需要进行设置。

 <ListView>
        <ListView.Template>
            <ControlTemplate>
                <Border CornerRadius="50" BorderThickness="50" BorderBrush="Red">
                    <ItemsPresenter></ItemsPresenter>
                </Border>
            </ControlTemplate>
        </ListView.Template>
        <ListViewItem Content="Harish"/>
        <ListViewItem Content="Harish"/>
        <ListViewItem Content="Harish"/>
        <ListViewItem Content="Harish"/>
    </ListView>

我希望这会有所帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-12-13
    • 2020-11-30
    • 2016-07-12
    • 2011-04-05
    • 2020-12-30
    • 2019-05-19
    相关资源
    最近更新 更多