RemoveFromSuperview shows white space

I am using a nested TabbedPage within Xamarin Forms but would like to remove this TabbedPage from iOS as I am re-creating it and placing it at the top of the page. I have a custom renderer and inside the ViewDidLoad method I am using this.TabBar.RemoveFromSuperview();

This removes the TabBar but the space it occupied is still there. Does anyone know how to remove this space?

Answers

  • MarketAllyMarketAlly USMember ✭✭

    @DanielPease.2022 said:
    I am using a nested TabbedPage within Xamarin Forms but would like to remove this TabbedPage from iOS as I am re-creating it and placing it at the top of the page. I have a custom renderer and inside the ViewDidLoad method I am using this.TabBar.RemoveFromSuperview();

    This removes the TabBar but the space it occupied is still there. Does anyone know how to remove this space?

    Did you figure this out?

  • DanielPease.3000DanielPease.3000 USUniversity

    Yep I figured it out. The fix is to remove the Tab Bar then resize the height of it's frame to 0.

    public override void ViewDidLoad()
    {
        base.ViewDidLoad();
        this.TabBar.RemoveFromSuperview();
        this.TabBar.Frame = new CGRect(this.TabBar.Frame.X, 
        this.TabBar.Frame.Y, this.TabBar.Frame.Width, 0);
    }
    
Sign In or Register to comment.