FormsAppCompatActivity and MasterDetailPage: no toolbar

The UPDATE . Apparently this is intentional, see here .


EDIT . It turns out the problem is that the toolbar is not added to MasterDetailPage, but rather to the page that I set as the Detail page (which is the navigation page in my case).

So, now the problem is: why is there no toolbar when I use MasterDetailPage?


I upgraded to the new FormsAppCompatActivity form. There are many errors, I look through them one by one.

Now the box is displayed on the toolbar. I want the toolbar to always be on top, so the drawer should be lower.

enter image description here

My RootView is MasterDetailPage:

        RootView = new MasterDetailPage {
            Master = PageSubs,
            Detail = AppNavPage,
        };

Here is my style.xml:

    <style name="LightTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="toolbar_style">@style/LightToolbar</item>

ToolbarStyle.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<resources>
    <style name="LightToolbar" parent="Widget.AppCompat.Toolbar">
        <item name="android:theme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
        <item name="android:popupTheme">@style/ThemeOverlay.AppCompat.Dark</item>
        <item name="android:background">#0087DC</item>
     </style>
    <style name="DarkToolbar" parent="Widget.AppCompat.Toolbar">
        <item name="android:theme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
        <item name="android:popupTheme">@style/ThemeOverlay.AppCompat.Dark</item>
        <item name="android:background">#ff0000</item>
     </style>
    <style name="AMOLEDToolbar" parent="DarkToolbar">
        <item name="android:background">#000000</item>
     </style>
 </resources>
+4

Source: https://habr.com/ru/post/1613045/


All Articles