Forum Xamarin.Forms

Announcement:

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 to remove blank space after removing tabbar from tabbed page

sweetssweets Member ✭✭

I want to remove Tabbar from TabbedPage. I got it working by using CustomRenderer but it leaves blank space or page height is not updated after hiding Tabbar.

Note that when we swipe through the pages, the blank space goes and never comes back. This issue appears only for the first time.

I have tried from this link. But it doesn't work.

Also tried following in my renderer class

private void Element_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            try
            {
                TabBar.Hidden = true;

                //TabBar.Bounds = new CoreGraphics.CGRect(View.Subviews[0].Frame.X, View.Subviews[0].Frame.Y,
                //                                                     View.Subviews[0].Frame.Width, 0);

                if (TabBar.Hidden)
                {
                    // page
                    View.Subviews[0].Frame = new CoreGraphics.CGRect(0, 0, View.Subviews[1].Frame.Width, NativeView.Frame.Height);

                    // Tabbar
                    View.Subviews[1].Frame = new CoreGraphics.CGRect(View.Subviews[0].Frame.X, View.Subviews[0].Frame.Y,
                                                                     View.Subviews[0].Frame.Width, 0);
                }
                else
                {
                    View.Subviews[1].Frame = new CoreGraphics.CGRect(View.Subviews[1].Frame.X, View.Subviews[1].Frame.Y,
                                                                     View.Subviews[1].Frame.Width, 49);
                    View.Subviews[0].Frame = new CoreGraphics.CGRect(View.Subviews[0].Frame.X, View.Subviews[0].Frame.Y,
                                                                     View.Subviews[0].Frame.Width, View.Subviews[0].Frame.Height - 49);
                }

Is there any way to remove blank space for the first time also ?

Thank you :smile:

Best Answer

Answers

  • sweetssweets Member ✭✭

    Thank you @ColeX for the answer. It Worked !!!

  • 15mgm1515mgm15 USMember ✭✭✭✭

    @ColeX This is not working on iOS 13 any ideas?

Sign In or Register to comment.