Unity 2D 4.6b UI: Why are instantiated prefab sprites rendering over UI elements?

I’m working on a 2D game with Unity 4.6 beta, and I’m using the new UI elements to make some buttons on a GUI overlay on screen. Whenever I instantiate a prefab (with a sprite) from code, however, the sprite is rendered on top of the UI elements. Why is that, and how can I change this behavior?

I’ve tried setting the layer of the prefabs and also through code on run-time to set it to a user defined layer, but it didn’t work. Am I doing something wrong?

I havent tested this yet, but I think you should play with the ‘Sorting Layer’ property (or the ‘Sort Order’/‘Order in Layer’) of both the SpriteRenderer and the Canvas Components.

(See the link(s) above for how to use these Layer(s))