Accessing properties of RectTransform via script

Hello,
I am trying to instantiate an UI Image on the go and i want to access its rect transform properties i.e.

  1. Left
  2. Pos Y
  3. Right
  4. Height

I’ve got the object access at runtime and even i’ve casted its transform to recttransform by

RectTransform rt = (RectTransform)(GameObjectNew.transform);

Now i don’t know how to get the properties of recttransform to edit the above listed properties. I’ve checed unity’s documentation but no help. Please help me out on this.

This is a pretty easy solve. Have you tried the documentation?

Check out anchorMax, anchorMin, offsetMax and offsetMin