import kivy
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.config import Config
kivy.require('2.0.0')
Config.set('graphics', 'fullscreen', '0')
class UiLayout(FloatLayout):
def __init__(self):
super().__init__()
# self.size = (500, 500)
self.button()
self.input_label = self.InputLabel()
def button(self):
# button
button_list = {}
# button style
style_dict = {'0': [0, 0], '.': [.15, 0], '=': [.3, 0], '+': [.45, 0],
'1': [0, .1], '2': [.15, .1], '3': [.3, .1], '-': [.45, .1],
'4': [0, .2], '5': [.15, .2], '6': [.3, .2], '*': [.45, .2],
'7': [0, .3], '8&#
kivy 实现一个计算器 FloatLayout
最新推荐文章于 2023-12-30 09:14:35 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)