Search Unity

Question Ui not updating correctly

Discussion in 'UGUI & TextMesh Pro' started by joxthebest314, Jan 31, 2021.

  1. joxthebest314

    joxthebest314

    Joined:
    Mar 31, 2020
    Posts:
    95
    The panel does not re-scale correctly (using content size fitter). To explain my problem, here are some pictures.
    Sans titre.png

    1. The panel object is yet how it is at first.

    Sans titre1.png

    2. Then, when I add an object, it does not rescale, despite the fact that the presets component overflows.

    Sans titre2.png

    3. But, strangely, it does when I add an other one...

    Sans titre4.png

    4. Here are the settings of the presets object in case it is needed.

    I just don't understand why the panel isn't re-scaling at the first time...
    Is there a parameter I missed ?

    Thanks for your help.
     
    Last edited: Feb 1, 2021
  2. joxthebest314

    joxthebest314

    Joined:
    Mar 31, 2020
    Posts:
    95
    I fixed it by using
    Code (CSharp):
    1. LayoutRebuilder.ForceRebuildLayoutImmediate(panel);
    But honestly, I don't think that is the best way to do it, so only temporary...