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