UGUI父物體根據子物體大小改變


起源於下圖這個三角嘆號:

 

 

解決方法:

 

 

 

Scroll View
--Viewport
----Content
    [Content Size Fitter]
      Vertical Fit: Preferred Size
    [Vertical Layout Group]
      Control Child Size: W/H
      Child Force Expand: W/H
------Prefab
      [Vertical Layout Group]
        Control Child Size: W/H
        Child Force Expand: W/H
--------TMP
--------Image
          [Layout Element]
            Min Height:20
--------TMP
--------TMP
--------TMP

來源於鏈接25樓:https://forum.unity.com/threads/layout-group-and-contentsizefitter-in-child.343082/

還有個聊天框顯示方案:https://stackoverflow.com/questions/53059487/unity3d-parent-has-a-type-of-layout-group-error

 

 

所以勾上 Control Child Size: W/H 試試


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM