【问题标题】:Customize Windows 10 UWP back button自定义 Windows 10 UWP 后退按钮
【发布时间】:2016-05-06 12:19:32
【问题描述】:

有没有办法自定义 UWP App_Back 按钮的背景颜色和大小?

【问题讨论】:

    标签: xaml win-universal-app


    【解决方案1】:

    有一种方法可以自定义标题栏。我想这篇文章会对你有所帮助:
    Easily manage the Title Bar in Windows 10 apps

    例如,您可以使用ApplicationView.GetForCurrentView().TitleBar property 编辑颜色:

    var titleBar = ApplicationView.GetForCurrentView().TitleBar;
    titleBar.ButtonBackgroundColor = Colors.Maroon;
    titleBar.ButtonForegroundColor = Colors.Yellow;
    

    或者您甚至可以通过此链接解决方案找到如何删除 chrome 并使用后退按钮创建自己的 chrome(有点复杂的方式)

    想法是使用CoreApplication class 设置应用程序“无铬”,代码如下:

    CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
    

    在此之后,您可以在 Window.SetTitleBar method 的帮助下创建您的 XAML 元素来代替标题栏

    【讨论】:

    • 我同意您的解决方案。另外,我不知道自定义 chrome 的可能性,谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-11
    • 1970-01-01
    • 1970-01-01
    • 2017-01-23
    • 2013-09-20
    • 2010-11-23
    相关资源
    最近更新 更多