Tabview not working?

It doesn’t seem to work for me at all unfortunately, although it looks correct in the UI Builder.

In game:
9794259--1405509--Screenshot 2024-04-24 200913.png

In editor:

9794259--1405506--Screenshot 2024-04-24 200954.png

<engine:UXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:engine="UnityEngine.UIElements" xmlns:editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
    <engine:TabView view-data-key="Tab1panel">
        <engine:Tab label="Tab1" view-data-key="Tab1tab">
            <engine:Label text="Label" />
        </engine:Tab>
        <engine:Tab label="Tab2" view-data-key="Tab2tab">
            <engine:Label text="Label" />
        </engine:Tab>
    </engine:TabView>
</engine:UXML>

What am I doing wrong? Using Unity 2023.2.19f1

Your images don’t work.

Thought it worked the first time. Anyway in case they don’t show up still: in game, the tab view shows as basically a flex-column with all elements visible and taking up all available space. It looks like this:

  • Tab1
  • Tab2
  • Label
  • Label

Hello! I tried in Unity6 and it seems to work. Does it work using the default runtime theme? You can also try re-importing your runtime theme.

Yes that was it, I was using a generated theme extracted from the built-in dark theme. But evidently at the time I did there was not any class for the tabview yet, so the tool did not export it.

Thanks for the hint, now after re-generaging it, it does work.

1 Like