How do I change the Title Background color On Windows Platform (Xamarin)

柔情痞子 提交于 2019-12-12 03:40:30

问题


Screen Shot I am developing an application using Xamarin Forms in Visual Studio 2013. I have managed to change the Header Background color for Android but I am failing to do the same for Windows project. It comes with the Default Dark theme. Please Assist me. Thank You


回答1:


NavigationPage.BarBackgroundColorProperty Works! Thank You for your suggestions.




回答2:


Your question is not very clear to me, but I think that this is what you mean. With "Header Background color" I think you mean the background color of the title of a page.

This is the code I use in my Xamarin.Forms application. The code works on Android, iOS and UWP.

public class ExamplePage : ContentPage
{
    public ExamplePage()
    {
        Title = "Example Page";
        BackgroundColor = Color.Blue; //Make this any color you like

        Content = null; //put your own content here
    }
}

You can specify the color of the background color on every page.




回答3:


 <StackLayout.BackgroundColor>
            <OnPlatform x:TypeArguments="Color"
                                    Android="#51C0D4"
                                    WinPhone="#51C0D4"
                                    iOS="#51C0D4"></OnPlatform>
    </StackLayout.BackgroundColor>


来源:https://stackoverflow.com/questions/41722253/how-do-i-change-the-title-background-color-on-windows-platform-xamarin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!