- Home /
Question by
ahmadian · May 21, 2017 at 08:27 AM ·
c#uirecttransform
Setting negative value for rectTransform sizedelta !!!
I've placed my UI With setting the anchorMin
and anchorMax
values in case my screen size changes.
I have a scroll view that will contain some buttons which will be created at runtime. I need to adjust the size of the scroll view's content part to be big enough for all the buttons, Since I adjusted the content part with anchorMin
and anchorMax
all I need to do is to assign a negative value to sizeDelta.y
so it extends from the bottom.
Now my problem is that no mater what I assign to it it always ends up positive.
For example if I say:
Content.GetComponent< RectTransform>().sizeDelta = new Vector2(0, -120);
in the editor the value is 120;
Comment