通用应用程序-标题栏中的透明按钮

本文关键字:透明 按钮 标题栏 应用程序 | 更新日期: 2023-09-27 17:59:06

所以我有这个代码

        var applicationView = ApplicationView.GetForCurrentView();
        var titleBar = applicationView.TitleBar;
        CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
        titleBar.ButtonBackgroundColor = Colors.Transparent;
        titleBar.ButtonForegroundColor = Colors.White;

但是菜单按钮(关闭、最小化、最大化)没有指定的透明背景。即使我使用ARGB并以这种方式设置它们,似乎也会忽略alpha值。有什么方法可以将它们设置为透明的吗?

通用应用程序-标题栏中的透明按钮

将ButtonBackgroundColor(etc.)设置为Colors.Transparent应该有效。我确认您的代码可以让我的背景图像在当前构建中显示出来。如果您还没有在10158上升级,请尝试一下。