Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

The attachable property 'ToolbarPlacement' was not found in type 'TabbedPage'. ERROR!

DacaramoDacaramo Member ✭✭

Hi everyone i'm trying to show a bottom tab bar in Android using Xamarin Forms. As some of you may know, by default tab bars in native Android aplications are at the top of the TabbedPage. After looking at Xamarin documentation in Microsoft Docs, it said that I must include some namespace and properties in the root tag as follows:

The thing is that the TabbedPage.ToolbarPlacement property is not being found by Visual studio:

Thank you in advance and I will be very gratefull if someone could help me! :)

PS: I have alredy:
1-Clean and rebuild the solution => NOT WORKING
2-Restart Visual Studio several times => NOT WORKING
3-Checked my Xamarin.Forms version...and yes is upper than 3.1 or whatever (is the last release) => NOT WORKING

Best Answer

  • LandLuLandLu Member, Xamarin Team Xamurai
    Accepted Answer

    This is a xaml compiling issue. It won't affect the actual deploying.
    It displayed in my project too:

    But project runs properly on the simulator:

    We could ignore this sort of error message.
    If you really don't like it, try to achieve it using code behind in the tabbed page class:

    using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
    using Xamarin.Forms.Xaml;
    
    namespace Sample
    {
        [XamlCompilation(XamlCompilationOptions.Compile)]
        public partial class MyTabbedPage : Xamarin.Forms.TabbedPage
        {
            public MyTabbedPage()
            {
                InitializeComponent();
    
                On<Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);
            }
        }
    }
    

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai
    Accepted Answer

    This is a xaml compiling issue. It won't affect the actual deploying.
    It displayed in my project too:

    But project runs properly on the simulator:

    We could ignore this sort of error message.
    If you really don't like it, try to achieve it using code behind in the tabbed page class:

    using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
    using Xamarin.Forms.Xaml;
    
    namespace Sample
    {
        [XamlCompilation(XamlCompilationOptions.Compile)]
        public partial class MyTabbedPage : Xamarin.Forms.TabbedPage
        {
            public MyTabbedPage()
            {
                InitializeComponent();
    
                On<Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);
            }
        }
    }
    
  • DacaramoDacaramo Member ✭✭

    Thanks a lot @LandLu , I was pretty sure that I ran the solution before, but it's perfectly working know :D . Do you know if there's plans of fixing that by the xamarin team? just curious about it.

Sign In or Register to comment.