Bypassing UIListLayout Filling Invisible Elements?

  1. What do you want to achieve? Keep it simple and clear!

For my UI, I want to make some frames in a UIListLayout turn invisible, while have other frames visible.

  1. What is the issue? Include screenshots / videos if possible!

Whenever I set one of the frames invisible, the UIListLayout automatically fills in that space. I need to find a way for the UIListLayout to ignore that empty space and keep my frames where they are.

An example of what I mean:

What I want my UI to look like:

BEFORE TURNING A FRAME INVISIBLE:

[Frame1, Frame2, Frame3]

AFTER TURNING Frame2 INVISIBLE:

[Frame1, SPACE, Frame3]

What it looks like instead:

BEFORE TURNING A FRAME INVISIBLE:

[Frame1, Frame2, Frame3]

AFTER TURNING Frame2 INVISIBLE:

[Frame1, Frame3]

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

One solution is to set every child in a frame to Transparency = 1, but with so many things in the frame, including TextLabels and ImageLabels (which all use BackgroundTransparency, TextTransparency, ImageTransparency, etc.), that would be very rigorous for what I am working on.

Here is a post that explains very well what I am trying to achieve, except I want this to be intentional, and not a bug as mentioned in this post.

Thank you for taking the time to read this.

EDIT: Here’s a visual demonstration of what my problem is.

could be you send a picture? kinda hard to imagine it

Maybe do

for i,v in pairs(frame) do
v.Transparency = 0
end)

Try making the frame invisible without toggling the Frame.Visible boolean

e.g. Frame.BackgroundTransparency = 1
Then make every textlabel and imagelabel inside of that frame invisible by turning off the visibility (TextLabel.Visible = false)

If this doesn’t work, please send images of your problem & the code that handles it.

Here are some ideas:

  • Use a CanvasGroup and set the GroupTransparency property to 1. This works well with items with a lot of different parts
  • Use the Transparency and other related properties to configure whether an item is visible or not. This is optimal for items of a single instance
  • Use a parent frame with Visible = true but fully transparent, and put the contents in the parent frame and set Visible = false that way
1 Like

The CanvasGroup solution helped. Thanks a lot, everyone!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.