我正在尝试更改 navigationPage 中 navigationBar 的背景颜色我正在使用以下代码:
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
}
}
}
我该怎么做?
只需设置 NavigationPage 实例的 BarBackgroundColor 属性即可:
new NavigationPage(new LoginPage()) { BarBackgroundColor = Color.Green };
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)