Ahmed Salah
Ahmed Salah

Reputation: 969

Where can I find ToolbarPlacement attribute of TabbedPage?

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?

Upvotes: 2

Views: 3950

Answers (3)

Fabio Barreto
Fabio Barreto

Reputation: 1

Customizations is changed:

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

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

Upvotes: 0

m.benissa
m.benissa

Reputation: 661

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"

Upvotes: 5

FreakyAli
FreakyAli

Reputation: 16547

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"

Upvotes: 1

Related Questions