如何更改Xamarin Forms項目中Android應用程序的所有頁面中ActionBar的可見性。我在主要活動中使用了ActionBar.Hide(),但它只在首頁隱藏它。在Xamarin PCL項目中隱藏Android Action Bar
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中構建的。有沒有辦法做到這一點?
它並沒有幫助。它仍然顯示ActionBar – fantaseador
另一種選擇是在Resources/values/Style.xml中創建自己的主題(如果沒有創建一個)像那裏一樣http://stackoverflow.com/a/14061826/1558147 並將它用作顯示在回答「'主題=」@樣式/我的主題「' – ad1Dima
添加到我的清單實際上崩潰我的應用程序在MainActivity的SetPage上的NullReferenceException – Jesse