Search Unity

Question Layout components glitching with scrollview

Discussion in 'UGUI & TextMesh Pro' started by orloKun, Mar 21, 2023.

  1. orloKun

    orloKun

    Joined:
    Jan 9, 2016
    Posts:
    7
    Hi everyone! I am working on a prototype where I am using TextMesh Pro input system and Unity UI toolkit (I am using Unity version 2020.3.27.f1) to create a more or less dynamic scroll list. Most of the time, everything works fine except for some glitches that I cannot seem to overcome. This happen specially when I turn objects active or inactive inside the content size fitter, they tend to overlap and then correctly update after the first interaction.
    I have read that updating either the Canvas with Canvas.ForceUpdateCanvases() or the Layout elements with LayoutRebuilder.MarkLayoutForRebuild (transform as RectTransform) would help, but I cannot seem to be able to use them. Besides Iam not sure of which would be a better approach considering that the app needs to have quite a few nested Layout elements with dynamic sized objects (specially input fields).

    What would be the best approach? I read some updates were about to be made to the UI system.
    Any ideas would be helpful. Thanks!

    upload_2023-3-21_15-19-24.png