Skip to content

Instantly share code, notes, and snippets.

@kived
Created October 1, 2014 17:23
Show Gist options
  • Save kived/08e10b150b4bab495bb4 to your computer and use it in GitHub Desktop.
Save kived/08e10b150b4bab495bb4 to your computer and use it in GitHub Desktop.
Kivy: maintain aspect ratio
import kivy
kivy.require('1.8.1')
from kivy.app import App
from kivy.lang import Builder
root = Builder.load_string('''
Button:
text: 'hi'
size_hint_y: None
height: .5*self.width
''')
class TestApp(App):
def build(self):
return root
if __name__ == '__main__':
TestApp().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment