3.9 – Layer

Layer property is used to determine the draw order of an item. Items with greater layer value are drawn later. Lastly drawn item is rendered on front. Layer property can be thought as a local value since it only determines the order of items which are in the same container. When you want to change the layer property of an item in code, use setLayer(int) method instead of setting the value of layer field directly.