如何在 Xamarin Forms 项目的 android 应用程序的所有页面中更改 ActionBar 的可见性。我在主要活动中使用了 ActionBar.Hide() ,但它仅在首页中隐藏它。
namespace ParsellIT.Droid
{
[Activity(Label = "ParsellIT", MainLauncher = true)]
public class MainActivity : AndroidActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
Xamarin.Forms.Forms.Init(this, bundle);
SetPage(App.GetMainPage());
ActionBar.Hide();
}
}
}
我想将它隐藏在每个页面中,但我无法访问 android 特定代码中的每个页面,因为它们是在 PCL 中构建的。有什么办法吗?