【发布时间】:2023-03-12 19:52:02
【问题描述】:
如何在 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 中构建的。有什么办法吗?
【问题讨论】:
标签: mono android-actionbar xamarin xamarin.forms