I encountered a strange “ScrollingFrame” optimization.
In short, “UIListLayout” is very strange.
UIListLayout settings
My code
local scrollingFrame = ScrollUi
local UIListLayout = scrollingFrame.UIListLayout
scrollingFrame.CanvasSize = UDim2.new(0, UIListLayout.AbsoluteContentSize.Y, UIListLayout.AbsoluteContentSize.X ) -- This makes sure the scrolling frame is scaled when the game starts.
local function onContentSizeChanged()
print("Debug1")
scrollingFrame.CanvasSize = UDim2.new(0, UIListLayout.AbsoluteContentSize.Y, UIListLayout.AbsoluteContentSize.X ) -- This makes sure the scrolling frame is scaled when ever there is something added into it during the game.
end
UIListLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(onContentSizeChanged)
if someone can solve this problem that was very good