1

First of all this post is related to that post: Xamarin Forms Android Error inflating class MaterialCalendarGridView

Before I post any code: The Flyout configuration of Xamarin Forms is correct! If I set IsPresented = true; in my flyoutpage the flyout menu is displayed correctly, the only problem I have is, that the top toolbar and the hamburger menu icon is missing completely on Android.

Here is the definition of my MainActivity.cs:

[Activity(ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation, ScreenOrientation = ScreenOrientation.Portrait, LaunchMode = LaunchMode.SingleTop, MainLauncher = true, Theme = "@style/MyTheme")]
    [IntentFilter(new[] { Intent.ActionView},
        DataScheme = "https",
        DataHost =  "myapp.com",
        AutoVerify = true,
        Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable})]
    [IntentFilter(new[] { Intent.ActionView },
        DataScheme = "http",
        DataHost = "myapp.com",
        AutoVerify = true,
        Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable })]

    public class MainActivity : FormsAppCompatActivity, Android.Gms.Tasks.IOnSuccessListener
    {
    ....

Here is my style.xml:

<?xml version="1.0" encoding="UTF-8"?>
<resources>
    <style name="MyTheme" parent="Theme.MaterialComponents.Light">
        <item name="android:colorPrimary">#ec1a23</item>
        <item name="android:colorPrimaryDark">#dd2c00</item>
        <item name="android:colorAccent">#ff3d00</item>
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
  </style>
    <style name="Theme.Splash" parent="Theme.MaterialComponents.Light">
        <item name="android:windowBackground">@drawable/splashscreen</item>
        <item name="android:windowNoTitle">true</item>
    </style>
</resources>

As seen mentioned as a solution in the related post, I´m not able to create a toolbar.xml file, because my app would crash at the startup. Regarding the AppCompat and Flyout documentation, it is not necessary at all.

I really don´t know what is the problem here.

WhiteIntel
  • 697
  • 1
  • 9
  • 24
  • Isn't the problem that you removed stuff needed by the toolbar? Seems to me that your previous question needs to be resolved in a way that doesn't remove toolbar-related Android xml lines. Then this question becomes moot. And probably should be deleted. – ToolmakerSteve Dec 17 '21 at 20:59

1 Answers1

0

I just came across this issue myself, the fix for me was there was a custom renderer:

[assembly: ExportRenderer(typeof(NavigationPage), typeof(CustomNavigationRenderer))]

This was originally added to fix Remove icon/logo from action bar on android and since it isn't required any more I was able to simply remove the custom renderer, and the toolbar displayed as it should.

0mpurdy
  • 3,198
  • 1
  • 19
  • 28