我想包括一些解決方案:刪除頂欄在Android上xamarin形式
<item name="android:actionBarSize">0dp</item>
或
var activity = (Activity)Forms.Context;
this.Window.AddFlags(WindowManagerFlags.Fullscreen);
或
RequestWindowFeature(WindowFeatures.NoTitle);
或活動串
Theme = "@style/MainTheme.FullScreen"
但我找不到任何可行的解決方案,或者更確切地說,將歌詞,電池時間等消除,但我仍然是頂級酒吧,我怎樣才能完全刪除它?
iOS上我已經添加:
UIApplication.SharedApplication.SetStatusBarHidden(true, true);
和作品......但是Android,他是讓我該死:) 解決方案?
我用xamarin形式PCL
我styles.xaml
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MainTheme" parent="MainTheme.Base">
</style>
<!-- Base theme applied no matter what API -->
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
<item name="windowNoTitle">true</item>
<!--We will be using the toolbar so no need to show ActionBar-->
<item name="windowActionBar">false</item>
<!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette -->
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">#2196F3</item>
<!-- colorPrimaryDark is used for the status bar -->
<!--<item name="colorPrimaryDark">#0084CA</item>-->
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">#2196F3</item>
<!-- You can also set colorControlNormal, colorControlActivated
colorControlHighlight and colorSwitchThumbNormal. -->
<item name="windowActionModeOverlay">true</item>
<!-- default -->
<item name="android:buttonStyle">@style/NoShadowButton</item>
<item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">#2196F3</item>
</style>
<style name="NoShadowButton" parent="android:style/Widget.Button">
<item name="android:stateListAnimator">@null</item>
</style>
</resources>
您是否嘗試將此項添加到您的活動中? '[Activity(Label =「@ string/app_name」,MainLauncher = true,Theme =「@android:style/Theme.Black.NoTitleBar.Fullscreen」)]' – Krumelur
是的,但不行,頂欄不隱藏 –