Change how children are resize.

Using rect.width & rect.height instead of sizeDelta.
Like that you can have the top container use stretch anchors

--HG--
branch : Ziboo/change-how-children-are-resize-using-rec-1443606808122
pull/413/head
Ziboo 2015-09-30 09:55:31 +00:00
parent 0992ad3df2
commit 8a32994697
1 changed files with 1 additions and 1 deletions

View File

@ -211,7 +211,7 @@ namespace UnityEngine.UI.Extensions
RectTransform child = _screensContainer.transform.GetChild(i).gameObject.GetComponent<RectTransform>();
currentXPosition = _offset + i * _step;
child.anchoredPosition = new Vector2(currentXPosition, 0f);
child.sizeDelta = new Vector2(gameObject.GetComponent<RectTransform>().sizeDelta.x, gameObject.GetComponent<RectTransform>().sizeDelta.y);
child.sizeDelta = new Vector2(gameObject.GetComponent<RectTransform>().rect.width, gameObject.GetComponent<RectTransform>().rect.height);
}
_dimension = currentXPosition + _offset * -1;