How do make UIListlayout fill from top

I’m having issues with UIListlayout, I want it to fill in from top meaning when a new textbox enters it will move the previous textbox downwards and the new one will stay on top but it completely the opposite at the moment, the new textbox enters from the bottom and old one stays at the top.

How it needs to be:
image

How it is at the moment:
image

Is there a way to achieve this

2 Likes

use the LayoutOrder property for this, when creating a new textbox set its LayoutOrder to the amount of textboxes parented to the scrollingframe + 1

2 Likes

How would you go on about that?

2 Likes

TextBox.LayoutOrder = (#ScrollingFrame:GetChildren()+1)

1 Like

but increasing the layoutorder still means going down the list

1 Like

try TextBox.LayoutOrder = -(#ScrollingFrame:GetChildren()+1)

1 Like

Fixed it, I used the same method but reversed it so

this would be the solution:

TextBox.LayoutOrder = (1-#ScrollingFrame:GetChildren())
1 Like

yep this works too, I’ll mark these as solution.

thank you @CZXPEK @Chrystian_PPP for helping with this issue.

2 Likes

Both of these lines of code work:

-- Both of these do the same calculation. Decreases the layoutOrder by the number of children in instance and +1.
TextBox.LayoutOrder = -(#ScrollingFrame:GetChildren()+1)  
---
TextBox.LayoutOrder = (1-#ScrollingFrame:GetChildren())
2 Likes

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