Scroll Viewã¨Layoutã³ã³ãã¼ãã³ã群â£Layout Group
Unity 2019.2.0f1 Personal(2019å¹´8æ)
ä»åã¯Layoutç³»ã³ã³ãã¼ãã³ãã®ä¸ã§ãLayout Groupã«ã¤ãã¦ã§ãã
Layout Groupã¨ã¯ï¼
Layout Groupã³ã³ãã¼ãã³ãã¯ã³ã³ãã³ãï¼åãªãã¸ã§ã¯ãï¼ãæ´åããã¾ãã
æ´å種é¡ã«ã¯Vertical(åç´)ãHorizontalï¼å¹³è¡ï¼ãGridï¼æ ¼åï¼ã®3種é¡ããã¾ãã
ï¼Layout Elementãå©ç¨ããå ´åã¯Control Child Sizeãæå¹ã«ããå¿
è¦ããããï¼
端æ«ã«ããã¢ã¹ãã¯ãæ¯ãå¤ãããªã©ã¬ã¤ã¢ã¦ãããºã¬ã¦ããæè»ã«æ´åãããã¨ãã§ãã¾ãã
Layout Groupã®è¨å®é ç®â
Paddingï¼ã³ã³ãã³ãå
¨ä½ã®ä¸ä¸å·¦å³ã®ä½ç½ãè¨å®ãã¾ããï¼åä½ï¼pixelï¼
Spacingï¼ã³ã³ãã³ãéã®ä½ç½ãè¨å®ãã¾ããï¼åä½ï¼pixelï¼
Child Aligmentï¼ã³ã³ãã³ããé
ç½®ããã¹ã¿ã¼ãä½ç½®ã
ãããã¸ãã¯å®éã«è§¦ãã°ç解ã§ãããã¨æãã¾ãï¼
Layout Groupã®è¨å®é ç®ï¼Control Child Size
Control Child Sizeï¼è¦ªï¼Layout Groupï¼ãåï¼Layout Elementï¼ã® Width (å¹ ) 㨠Height (é«ã) ãå¶å¾¡ãããã©ããã
Control Child Sizeãæå¹ã«ããã¨ã
ã³ã³ãã³ãï¼Layout Elementã®ä»ãããªãã¸ã§ã¯ãï¼ã®Layoutæ
å ±ã¯Auto Layoutã®ã«ã¼ã«ã«å¾ã決å®ããã¾ãã
ä¾ãã°Control Child Sizeã®Heightã®ã¿æå¹ã«ããã¨â¦
ã³ã³ãã³ãï¼Layout Elementã®ä»ããåãªãã¸ã§ã¯ãï¼ã®RectTransformã¯Widthãè¨å®å¯è½ã§ããã
Heightã¯Layout Elementã«å¾ãèªåçã«è¨å®ããã¾ãã
Layout Groupã®è¨å®é ç®ï¼Child Force Expand
Child Force Expandï¼ä»å çãªå©ç¨å¯è½ãªã¹ãã¼ã¹ãåããããåè¦ç´ ãå¼·å¶çã«æ¡å¤§ãããã©ããã
ã»Control Child Sizeã¨éããRectTransformããå¤ãè¨å®ã§ããã
ï¼Layoutãå´©ããããã®ã§åºæ¬çã«ç¡å¹ã«ãã¦ãããï¼
ã»Layout Elementã®æç¡ã¨ã¯é¢ä¿ãªãã³ã³ãã³ãã¯çééã«é
ç½®ãããã
ã»Control Child Sizeã¨åããã¦ä½¿ãã¨ãä½ç½ãããå ´åã¯Layout Elementã®Prefered Widthã®è¨å®å¤ä»¥ä¸ã«ã¹ãã¼ã¹ãåãããï¼Flexible WIdthãè¨å®ãã¦ããç¶æ
ã¨åãçµæï¼
Use Child Scale
Use Child Scaleï¼å¹
ã¨é«ãã¯ãååã¬ã¤ã¢ã¦ãè¦ç´ ã®Rect Transformã³ã³ãã¼ãã³ãã®Scale> Xããã³Scale> Yã®å¤ã«å¯¾å¿ãã¾ãã
RectTransformããå¤ãè¨å®ãããã¨ãã§ããã
ãããç¡å¹ã§ãå¯è½ãªã®ã§ãéããåãããªãâ¦
ã¾ã ã¾ã å
¨ç¶ç解ã§ãã¦ããªãã§ããã
使ãè¾¼ãã§ãããã¡ã«åæãåãã£ã¦ãããã¨æãã¾ãã