How to control the length of a multi-tab ActionBar

I am trying to come up with a tabbed page using ActionBar in my MainActivity.cs file of the Xamarin.Android project as follows.

ActionBar.NavigationMode = ActionBarNavigationMode.Tabs;
ActionBar.Tab mainTab = ActionBar.NewTab();
mainTab.SetText("some name");
mainTab.SetIcon(some icon);
mainTab.TabSelected += (sender, args) => { };


When the number of tabs is getting on 5 the tabs are getting out of the screen (creating a horizontal scroll). I was wondering if there is any way where I can avoid this. E.g., put the ActionBar into an xml Layout, or any other strategy. Any tip will be highly appreciated. Thanks in advance.


Sign In or Register to comment.