Hide Bottom Tabbed bar in tabbed page and fit the content to full screen

SurbhiAroraaSurbhiAroraa Member ✭✭✭

I am using the tabbed page renderer for hiding the bottom tabbed bar. Able to hide the bottom bar but still there is white space in the bottom where tabbed bar was present. In android I am setting the height for the content to full screen , but in iOS same kind of thing is not happening. How to fit the content to full screen after hiding. Any suggestions. @LandLu @JamesMontemagno @JohnHardman @JohnMiller Thanks in advance.

Best Answer

Answers

  • ColeXColeX Member, Xamarin Team Xamurai
    edited September 26

    Put the code into the method ViewDidLayoutSubviews ,it works fine on my side .

    [assembly: ExportRenderer(typeof(TabbedPage),typeof(MyRenderer))]
    namespace App18.iOS
    {
        class MyRenderer :TabbedRenderer
        {
    
            public override void ViewDidLayoutSubviews()
            {
                base.ViewDidLayoutSubviews();
    
                TabBar.Hidden = true;
    
                var page = View.Subviews[0];
                var tabbar = View.Subviews[1];
    
                tabbar.Bounds = CGRect.Empty;
                page.Bounds = UIScreen.MainScreen.Bounds;
            }
        }
    }
    
  • SurbhiAroraaSurbhiAroraa Member ✭✭✭

    @ColeX said:

    it is working fine in this method, but this method gets called only when we are navigating to that page. Once we are inside the page and I tries to change the property Hidden , white space is still there. How to handle the behaviour in property changed event. TIA

  • ColeXColeX Member, Xamarin Team Xamurai

    Which property do you use to hide the Bottom tabbar ?

  • SurbhiAroraaSurbhiAroraa Member ✭✭✭

    @ColeX said:
    Which property do you use to hide the Bottom tabbar ?

    I am using Hidden property(true/false) for hiding the bar.

  • ColeXColeX Member, Xamarin Team Xamurai

    Hidden property ? Do you create custom Tabbed page and custom property ? Can you attach the code where you call it ?

  • SurbhiAroraaSurbhiAroraa Member ✭✭✭
    Accepted Answer
    @ColeX , I used this solution -
    https://stackoverflow.com/questions/46119640/how-to-hide-tab-bar-on-push-in-xamarin-forms
    It is working as per my requirement.
    Thank You :)
  • ManishPradhanManishPradhan Member ✭✭
    edited October 17

    @ColeX This is still leaving a White Blank Space at the bottom. Seems the Page's bounds are not being updated. ANy ideas? Testing on iOS 13

  • 15mgm1515mgm15 USMember ✭✭✭✭

    @ManishPradhan Have you found a solution?

  • 15mgm1515mgm15 USMember ✭✭✭✭

    @ColeX I have this navigation:

    TabbedPage
        NavigationPage
            ContentPage
        NavigationPage
            ContentPage
        NavigationPage
            ContentPage
        NavigationPage
            ContentPage
        NavigationPage
            ContentPage
    

    And since iOS 13 the hidden TabBar is showing a blank space, I have tried a lot of things but I haven't figured out the issue, do you have any ideas?

  • ManishPradhanManishPradhan Member ✭✭

    @LandLu Any ideas? Thanks.

  • Liêm_NguyễnLiêm_Nguyễn USMember ✭✭✭✭

    @SurbhiAroraa said:
    @ColeX , I used this solution -
    https://stackoverflow.com/questions/46119640/how-to-hide-tab-bar-on-push-in-xamarin-forms
    It is working as per my requirement.
    Thank You :)

    It's not working on iOS 13

Sign In or Register to comment.