【发布时间】:2020-03-17 07:52:23
【问题描述】:
我目前正在开发一款适用于移动设备的 kivy 应用程序。我有一些标签和按钮,如果我运行程序,它们的位置很好,但是当我缩小窗口时,标签和按钮中的文本会离开屏幕。任何人都可以提出更好的位置和大小提示,以便即使最小化窗口它们也不会离开屏幕? 这是我的代码:
Label:
color: 1,0,0,1
pos_hint:{ "top":5,"left": 1}
size_hint:1,1
text: "Which number cannot be written in roman numbers?"
font_size: 30
BoxLayout:
Button:
pos_hint:{"top": 1,"left": 1}
size_hint:1,1
text: "0"
font_size: 30
size: 30,30
on_release:
self.background_color = 250,255,0,0.3
Button:
pos_hint:{"top": 1,"left": 1}
size_hint:1,1
text: "1 million"
font_size: 30
size: 30,30
on_release:
self.background_color = 1, 0, 0, 1
BoxLayout:
Button:
pos_hint:{"top": 1,"left": 1}
size_hint:1,1
text: "999"
font_size: 30
size: 30,30
on_release:
self.background_color = 1, 0, 0, 1
Button:
pos_hint:{"top": 1,"left": 1}
size_hint:1,1
text: "10 million"
font_size: 30
size: 30,30
on_release:
self.background_color = 1, 0, 0, 1
【问题讨论】:
标签: python android button kivy kivy-language