Elements created at runtime not displaying

Hi, I’m trying to instantiate a uxml template and display it in a box at runtime, but it is invisible.
Here’s what I mean:
9736039--1392391--12VStCCYuk.png
The element is visible in the debug layout viewer, but not rendering in the ui itself.
For reference, it should look something like this:
9736039--1392394--upload_2024-3-28_18-2-17.png

I’ve reduced the problem to a simple black frame, and the problem persists.

var elem = new VisualElement();
elem.style.backgroundColor = new StyleColor(new Color(0, 0, 0, 1));
Content.Add(elem);

Content refers to the white container box. This code gets ran, I know that (in the case of when I was using the template) OnAttachToPanel is being fired, it is just not visible. I’m totally lost… any ideas?

hi, just wanted to update with a disappointing solution :stuck_out_tongue:

The parent element had a copy hidden somewhere by accident that I was completely unaware of. I found it, got rid of it, and everything works now.