我工作的一個項目Xamarin.Forms工作,我剛剛發現隱藏與此代碼的狀態欄圖標的方式:不能忠實地隱藏狀態欄的Android與Xamarin.Forms
this.Window.AddFlags(WindowManagerFlags.Fullscreen | WindowManagerFlags.TurnScreenOn);
現在我試圖隱藏藍色狀態欄,我嘗試了兩種不同的方式,既沒有工作: 1)該代碼添加到activity.cs:
SetStatusBarColor(Color.Transparent);
2)寫這幾行在style.xml中的所有可能組合中(在Resources/value中):
<item name="colorPrimary">@android:color/transparent</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
似乎沒什麼可行的,我該怎麼辦?
你從哪個對象獲得了你的活動?你正在測試什麼設備? API級別? –
其實我找到了出路!我會去衝它 –