如何改变背景COLR在Xamarin形成NavigationPage [英] How to change backGround colr in Xamarin forms NavigationPage
本文介绍了如何改变背景COLR在Xamarin形成NavigationPage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
进出口新的Xamarin的形式和试图改变导航栏的背景色navigationPage我使用这个系统code`using;
Im new to Xamarin forms and trying to change the background color of navigationBar in navigationPage i'm using this code`using System;
using System;
using Xamarin.Forms;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
namespace P
{
public class App : Application
{
public App ()
{
MainPage = new NavigationPage(new LoginPage());
}
protected override void OnStart ()
{
}
protected override void OnSleep ()
{
}
protected override void OnResume ()
{
// Handle when your app resumes
}
}
}
我该怎么办呢?
推荐答案
只需设置BarBackgroundColor在NavigationPage实例的属性:
Just set the BarBackgroundColor property of the NavigationPage instance:
new NavigationPage(new LoginPage()) { BarBackgroundColor = Color.Green };
这篇关于如何改变背景COLR在Xamarin形成NavigationPage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文