Search code examples
xamarin.formsxamarin.android

Xamarin.Forms Bottom Menu for Android


I managed to show menu bar on bottom on Android. I followed this guide exactly : https://asyncawait.wordpress.com/2016/06/16/bottom-menu-for-xamarin-forms-android/#more-24

My issue is that I am working on a RTL (Right to Left) Language app, so I want to show the last tab as the default activated tab on load. So I changed the following in PopulateChildren Method:

        LoadPageContent(0);

To:

        LoadPageContent(3); //I have total 4 pages (0,1,2,3)

Now the last page is loaded by default but the Selected color of the tab is still on the first tab. screenshot
(source: cubeupload.com)

I want to show the selected tab color on the last page. How can I do it??


Solution

  • In PopulateChildren Method in your renderer add these two lines

    LoadPageContent(3); //This will load the 4th page
    _bottomBar.SelectTabAtPosition(3, false); //This will move the bottomBar selected tab position to the 4th tab