I'm designing a simple Kivy-based app that has an image in a Scatter widget and two buttons at a fixed position on the screen.
depthproblem.kv:
FloatLayout:
Scatter:
Image:
source: "img.png"
Button:
text: "Alpha"
pos_hint: {"x":0.00, "y":0}
size_hint: 0.20, 0.15
Button:
text: "Beta"
pos_hint: {"x":0.20, "y":0}
size_hint: 0.20, 0.15
depthproblem.py:
from kivy.app import App
class DepthProblemApp(App):
pass
DepthProblemApp().run()
The program starts with the buttons on top of the image, which is what I intend. This is because the buttons are declared after the scatter.
But when I touch the image, it lifts the image layer above the buttons. I don't understand why this happens, and couldn't find any documentation about how to control this behavior (searched z-index, order, layer, depth, etc.).
How can I specify the buttons to always be painted on top of the scatter/image?
![Bad](https://i.stack.imgur.com/seNVp.png)