#float.py
from kivy.app import App
from kivy.base import runTouchApp
from kivy.uix.widget import Widget
class Float(Widget):
pass
class FloatApp(App):
def build(self):
return Float()
FloatApp().run()
--------------------
#float.kv
<Button>:
font_size:40
color:0.3, 0.6, 0.7, 1
size_hint: 0.5, 0.5
<Float>:
FloatLayout:
size: root.width, root.height
Button:
pos_hint: {"x": 0.5, "top": 1}
text: "Button"
Button:
id: btn
pos_hint: {"y": 0}
text: "up" if btn.state == "normal" else "down"
background_color: 0.3, 0.4, 0.5, 1
reference:
No comments:
Post a Comment