Forum Xamarin.Android


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

How can I set selected tab background in Tabbed Page?

NorbertKNorbertK PLMember
edited April 2017 in Xamarin.Android


I have to do something, that I expected to be rivial, yet it isn't. I need to customize layout of tabbed page in my app and I've got stucked.

After not founding a solution for Xamarin Forms I tried to implement this part in a device specific code. I tried to implement this solution in my app Droid project.

So I've added tab_layout.xml file to Resources/drawable:
<?xml version="1.0" encoding="utf-8" ?> <selector xmlns:android=""> <item android:color="#404454" android:state_selected="true"/> <item android:color="#ecedee"/> </selector>

And adden tab_layout.axml into Resources/layout:
<?xml version="1.0" encoding="utf-8"?> < app:tabBackground="@drawable/tab_color_selector" />

Unfortunetly, I'm getting such an error:

No resource found that matches the given name (at 'tabBackground' with value '@drawable/tab_color_selector').

I've tried to reach tabBackground in many different namespaces, like following, whith no success what so ever:


Does anybody know how to get this done?

Sign In or Register to comment.