0
我剛開始學習Kivy,並與元素大小混淆。比方說,我想創建視頻播放器時間欄,中間有進度條,兩側有時間標籤。與Kivy中的元素大小混淆
我走到這一步:
<[email protected]>:
width: 100
padding: 10, 0
font_size: '14sp'
<Player>:
BoxLayout:
orientation: 'horizontal'
pos: 0, 0
size: root.width, 40
canvas:
Color:
rgba: 0, 0.5, 0, 0.8
Rectangle:
pos: self.pos
size: self.size
TimeLabel:
size_hint: None, 1
text: "0"
ProgressBar:
value_normalized: 0.5
TimeLabel:
size_hint: None, 1
text: "10:00:00"
在Windows上的一切似乎是確定:
在我的Galaxy S4雖然不是:
正如你在上一個截圖中看到的那樣o很低,進度條進入時間標籤。因爲我可以增加酒吧的高度和標籤的寬度,但在這種情況下,這一切都將在Windows上太大。
如何在Android上修復尺寸以在Windows上保存當前比例?