2

I'm trying to locate the Tabbing bar in the bottom of the screen in android and I already did in the C# code behind but I'm just wondering how to do that in the .xaml code?

I've added the Xamarin.Forms.PlatformConfiguration.AndroidSpecific namespace but can't find the ToolbarPlacement attribute to set it to "Bottom" like is shown in the image below.

enter image description here

So is there a way to set it in the xaml code?

Ahmed Salah
  • 851
  • 2
  • 10
  • 29

3 Answers3

5

Toolbar Placement

It is possible to get these tabs at the bottom with a specific platform:

On XAML code :

<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage  xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
             android:TabbedPage.ToolbarPlacement="Bottom" >

The blue line indicates that ToolbarPlacement or others cannot be found. It is a problem of intelligisense because they are not properties and are real constructive arguments. don't worry, they work great!

Or in C# code behind:

using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;

On<Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);

you can also use these properties to customize the bar at the bottom

BarBackgroundColor="#2196F3"
android:TabbedPage.BarItemColor="Wihte"
android:TabbedPage.BarSelectedItemColor="#66FFFFFF"
BarTextColor="White"
Maher Ben Issa
  • 651
  • 7
  • 12
1

From what I see your Xamarin.Forms package is not up to date because of which you are unable to use that feature. Just update the Xamarin.Forms package to 3+ and I think that should solve your issue.

Feel free to revert in case of queries

Update:

Try adding the following lines manually and try if it works:

xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
android:TabbedPage.ToolbarPlacement="Bottom"
FreakyAli
  • 13,349
  • 3
  • 23
  • 63
  • Thanks for help but my version is X.F 3.4 and it does not work though. – Ahmed Salah Dec 02 '18 at 10:02
  • 2
    I've tried that before but I got a "property 'ToolbarPlacement' was not found in type 'TabbedPage'" error message but when you told me to try that (of course I got same error) but when I rebuild the project surprisingly, it's built succeeded and it works too! thank you. – Ahmed Salah Dec 03 '18 at 18:39
0

Customizations is changed:

From: android:TabbedPage.BarItemColor="Wihte" android:TabbedPage.BarSelectedItemColor="#66FFFFFF"

To: SelectedTabColor="White" UnselectedTabColor="#66FFFFFF"