Bottom Tabbed page issues

I am trying to use a bottom Tabbed Page for Xamarin Forms (Android).
I have this error message:
'IPlatformElementConfiguration<Android, TabbedPage>' does not contain a definition for 'SetToolbarPlacement' and no extension method 'SetToolbarPlacement' accepting a first argument of type 'IPlatformElementConfiguration<Android, TabbedPage>' could be found (are you missing a using directive or an assembly reference?)
Anyone have the same issue here?
looks like my 'Toolbarplacement' is missing

Answers

  • XinshuaiDingXinshuaiDing USMember

    by the way, the xamarin form version is 3.1.0.637273

  • ClintBClintB Member ✭✭

    I am having the same issue. I've tried both in the XAML and in the code behind. I get the same error with the code behind and in the XAML it says: The attachable property 'ToolbarPlacement' was not found in type 'TabbedPage'.

    I am trying to follow the article provided by Microsoft on Android platform specifics

  • shellddorshellddor Member ✭✭

    Good day!
    Faced such a problem. At first I thought that the problem in the code, but after downloading the sample code and running it in VS received the same message

    'IPlatformElementConfiguration<Android, TabbedPage>' does not contain a definition for 'SetToolbarPlacement' and no extension method 'SetToolbarPlacement' accepting a first argument of type 'IPlatformElementConfiguration<Android, TabbedPage>' could be found (are you missing a using directive or an assembly reference?)

  • seanydaseanyda GBMember ✭✭✭✭✭
    edited August 2018

    Do you have this using statement?

    using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
    
  • shellddorshellddor Member ✭✭
    edited August 2018

    Oh sure.
    Here is the code in which the error occurs:

    using Xamarin.Forms;
    using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
    using Xamarin.Forms.PlatformConfiguration;
    using Xamarin.Forms.Xaml;

    namespace App1
    {
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class MainPage : Xamarin.Forms.TabbedPage
    {
    public MainPage ()
    {
    InitializeComponent();
    On().SetToolbarPlacement(ToolbarPlacement.Bottom);
    }
    }
    }

  • seanydaseanyda GBMember ✭✭✭✭✭

    @shellddor said:
    Oh sure.
    Here is the code in which the error occurs:

    using Xamarin.Forms;
    using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
    using Xamarin.Forms.PlatformConfiguration;
    using Xamarin.Forms.Xaml;

    namespace App1
    {
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class MainPage : Xamarin.Forms.TabbedPage
    {
    public MainPage ()
    {
    InitializeComponent();
    On().SetToolbarPlacement(ToolbarPlacement.Bottom);
    }
    }
    }

    I thought it was supposed to be

    On<Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);
    
  • shellddorshellddor Member ✭✭

    The same mistake.
    Code:

    using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
    using Xamarin.Forms.Xaml;

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

    Errors:
    The type or namespace name 'App' could not be found (are you missing a using directive or an assembly reference?) ...App1\App1.Android\MainActivity.cs 1

    The name 'ToolbarPlacement' does not exist in the current context ...
    ...App1\App1\MainPage.xaml.cs 1

    Dependent project App1.csproj failed to build, using old version. 1

    'IPlatformElementConfiguration<Android, TabbedPage>' does not contain a definition for 'SetToolbarPlacement' and no extension method 'SetToolbarPlacement' accepting a first argument of type 'IPlatformElementConfiguration<Android, TabbedPage>' could be found (are you missing a using directive or an assembly reference?) ...App1\App1\MainPage.xaml.cs 1

  • WillBicksWillBicks USMember

    I've been scouring the internet for hours trying to find a solution to this issue, and I finally discovered something that worked, at least for me. It's a little bit hacky, but it seems to work reliably for me.

    I first got a hint after updating to VS version 15.8.1, when I was able to successfully run my application. Then I went to re-enable Xamarin Live Player after the update, tried to run my application, and the error came back.

    Using the VS installer, I repaired my installation to reset my settings and therefore disable Xamarin Live Player (which could be unrelated, but seems to be correlated with the issue being present), and I am now able to compile without error!

    I'd be interested to hear whether this is just me, or if this works for others.

  • WillBicksWillBicks USMember

    I've been scouring the internet for hours trying to find a solution to this issue, and I finally discovered something that worked, at least for me. It's a little bit hacky, but it seems to work reliably for me.

    I first got a hint after updating to VS version 15.8.1, when I was able to successfully run my application. Then I went to re-enable Xamarin Live Player after the update, tried to run my application, and the error came back.

    Using the VS installer, I repaired my installation to reset my settings and therefore disable Xamarin Live Player (which could be unrelated, but seems to be correlated with the issue being present), and I am now able to compile without error!

    I'd be interested to hear whether this is just me, or if this works for others.

  • dmskr123dmskr123 Member

    just rebuild solution

Sign In or Register to comment.