Runtime Width of layout item inside auto layout group in Unity 4.6

I am trying to get the width of an element inside VerticalLayoutGroup

var width = (element.transform as RectTransform).rect.width;

      

but I am returning 0

as it is RectTransform

driven by auto layout. How to measure the runtime width?

Edit

I am trying to scale a RawImage

+3


source to share





All Articles