【发布时间】:2017-11-21 17:33:38
【问题描述】:
我在当前 GUI 的左上角有很多卡住了,我试图将其基本展开并使我的图像具有正常大小(类似于下面显示的模型)。我想我需要向下扩展 Y 方向以适应它(使顶部区域更大以适应它)?但是,当我将 size_hint_y 更改为 > 1 时,它会将文本向上隔开,并在 GUI 之外切断。有任何想法吗?非常感谢!
我的kv文件:
#:kivy 1.10.0
<WeatherWidget>:
cols: 1
BoxLayout:
size_hint_y: None
BoxLayout:
size_hint_x: 1
size_hint_y: 1
orientation: "vertical"
Image:
source: 'Code32.png'
keep_ratio: False
halign: 'center'
Label:
text: root.current_temperature()[:3]
bold: True
font_size: 40
Label:
text: root.high_low_temp(0)
font_size: 15
color: [1,255,1,1]
Label:
text: root.get_location()
font_size: 15
color: [1,1,1,1]
bold: True
Label:
text: root.sunrise()
font_size: 10
color: [1,1,1,1]
Label:
text: root.sunset()
font_size: 10
color: [1,1,1,1]
BoxLayout:
orientation: 'vertical'
Image:
source: 'Code32.png'
Label:
text: root.forecast_day(1)
Label:
text: root.high_low_temp(1)
font_size: 12
color: [1,255,1,1]
Label:
text: root.forecast_day(2)
Label:
text: root.forecast_day(3)
Label:
text: root.forecast_day(4)
Label:
text: root.forecast_day(5)
BoxLayout:
size_hint_y: None
BoxLayout:
orientation: 'vertical'
Button:
text: root.TimeHours + ':' + root.TimeMinutes
size_hint_x: 1
font_size: 40
size: self.size
bold: True
halign: 'center'
Label:
text: root.current_date()
size_hint_x: 1
font_size: 15
bold: True
halign: 'center'
【问题讨论】:
标签: python kivy kivy-language