How can I hide the ActionBar
of an Activity
in Xamarin.Forms
? I tried the following but none of it worked:
ActionBar.Hide()
in OnCreate()
"@android:style/Theme.Holo.Light.NoActionBar"
you can just hide it in your constructor
public partial class MyPage : ContentPage
{
public MyPage()
{
NavigationPage.SetHasNavigationBar(this, false);
InitializeComponent();
}
}
Just found the solution parallel to @Pete. It seems that this is a bug under Xamarin.Forms
at the moment.
I added this in my Styles.xml
and set the theme to my Activity
:
<?xml version="1.0" encoding="UTF-8" ?>
<resources>
<style name="NoActionBarTheme" parent="android:Theme.Holo.Light">
<item name="android:actionBarStyle">@style/invisible_action_bar_style</item>
</style>
<style name="invisible_action_bar_style" parent="android:Widget.Holo.ActionBar">
<item name="android:height">0dp</item>
</style>
</resources>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With