Dacaramo
Dacaramo

Reputation: 75

The attachable property 'ToolbarPlacement' was not found in type 'TabbedPage'. [Xamarin.Forms]

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:

<TabbedPage xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecificassembly=Xamarin.Forms.Core"
            android:TabbedPage.ToolbarPlacement="Bottom">
    ...
</TabbedPage>

The thing is that the TabbedPage.ToolbarPlacement property is not being found by Visual studio: Here you can see the error

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

Upvotes: 1

Views: 1250

Answers (1)

Leo Zhu
Leo Zhu

Reputation: 15011

I have the same issue as you,but i could work when i ignore the warning and it doesn't give me the error.You could try to do this in your page.cs by behind codes On<Android>().SetToolbarPlacement(ToolbarPlacement.Bottom).

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

Upvotes: 1

Related Questions