I'm trying to get an image into my Boxlayout. I want this image to fill all of the screen width and I want it to keep aspect ratio. In the remaing space at the bottom of the screen I want to have a button, which fills all of the remaining space. To illustrate what I'm trying to achive I made this little doodle:

So I want the img_width to be = screen_width.
I want the img_height to be the size it has to be, to keep aspect ratio.
I want the button width to be = screen_width
And I want the button height to take up the remaining height. So I want button_height = screen_height-button_height
I tried many things but I simple could not get what I want. This is an example of what I tried:
Code hier eingeben.from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.image import Image
class MainImage(BoxLayout):
pass
class KommaApp(App):
def build(self):
a = MainImage()
return a
if __name__ == '__main__':
KommaApp().run()..
Code hier eingeben.
<MainImage@BoxLayout>:
orientation: 'vertical'
width: main_image.width
height: main_image.height
Image:
id: main_image
source: '02.jpg'
Button:
text: 'Button A'
..
Any help on this would be appreciated :) Thanks