kaolick kaolick - 5 months ago 65
Android Question

How to hide Android ActionBar in Xamarin.Forms?

How can I hide the

ActionBar
of an
Activity
in
Xamarin.Forms
? I tried the following but none of it worked:


  • calling
    ActionBar.Hide()
    in
    OnCreate()

  • setting the theme to
    "@android:style/Theme.Holo.Light.NoActionBar"


Answer

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>