UI prefab instantiation problem

I want to instantiate a UI prefab from Resources and append it to canvas but there is a problem with that After instantiation scale and position values of prefab in rect transform component how to solve this ?

Simply change the order of your code.

Set the Parent and Then fix the scale.