我需要在我的UWP(WinUI 2)应用程序中使用圆角,但根据我的理解,这是不可能的。所以我发现了github的问题,那就是WinUI 3允许你在窗口上创建圆角(就像在新的窗口搜索中一样)。也许有人能帮我这个忙?
发布于 2020-07-03 23:34:24
在支持它的控件上,只需设置CornerRadius
属性。有关如何在整个应用程序中使用样式设置此设置的说明,请参阅:https://docs.microsoft.com/en-us/windows/uwp/design/style/rounded-corner
如何在单独的控件上进行设置在这里有专门的文档:Control.CornerRadius Property
<Button Content="Button"
CornerRadius="15" />
<Border BorderThickness="5"
BorderBrush="Black"
CornerRadius="15" />
您可以很容易地在Xaml Studio中看到这一点
如果你问是否直接支持在页面上设置这个属性,我想答案是不支持的。我没有看到任何文档表明它是这样的。
有关可能的解决办法,请参阅:Creating chromeless, non-rectangular Windows from UWP或Is it possible to create a borderless UWP application?。
https://stackoverflow.com/questions/62666453
复制相似问题