Skip to content

[BUG] DrawingView does not render correctly after tab navigation (TabBar) #2078

Closed

Description

@Ghibytzu

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

In a MAUI app, when using a TabBar structure for the UI, on application startup DrawingView is rendered correctly and all the controls work as expected. However after navigating to SecondaryPage (tab) and back to the MainPage (tab) the DrawingView is not rendered correctly anymore.

Expected Behavior

DrawingView remains rendered correctly during TabBar navigation.

Steps To Reproduce

  1. Open and run the solution from the reproduction repository on Windows machine.
  2. Observe the DrawingView control.
  3. (optional) Interact with Drawing View control.
  4. Navigate to Secondary tab.
  5. Navigate to Main tab.

Link to public reproduction project repository

https://github.com/Ghibytzu/DrawingViewWithTabBarNet8/tree/master

Environment

- .NET MAUI CommunityToolkit: 9.0.2
- OS: Windows 11 Build 10.0.22631.3880
      Android Emulator pixel 5 api 33
- .NET MAUI: 8.0.61

Anything else?

Important Note: There is a similar issue on Android, after navigation the DrawingView remains rendered but cannot be accessed. E.g. method DrawingView.ClearI() does not clear the content and other controls ignore DrawingView's position.
Screenshot_1722443778

Important Note2: Also, I tried the same code on .NET MAUI CommunityToolkit: 6.1.0 with .NET Framework 7.0 and the issue does not reproduce: DrawingView works as expected during tab navigation (TabBar).

Additional debugging steps performed
I tried several methods like overriding the OnAppearing() method of the Content page but with no avail:

  protected override void OnAppearing()
   {
       base.OnAppearing();
       ReinitializeDrawingView();
   }
   
       private void ReinitializeDrawingView()
   {
       if (!MainLayout.Children.Contains(drawView))
       {
           MainLayout.Children.Insert(0, drawView);
       }
   }

After navigation DrawingView has IsVisible = true but IsLoaded = false and is not rendering on screen.

Activity

  1. vplife1 commented on Aug 26, 2024

    @vplife1

    @Ghibytzu Facing the same issue have you found any workaround ??

  2. vplife1 commented on Aug 26, 2024

    @vplife1
  3. mdelgadov commented on Feb 18, 2025

    @mdelgadov

    I have the same problem. Also, the height changes to 0 and even if changed, it returns to 0 in the next navigation.

  4. locked and limited conversation to collaborators on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/viewsIssue/Discussion/PR that has to do with ViewsbugSomething isn't workingunverified

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions