Se non si sa quale layout da utilizzare, quindi utilizzare layout a griglia, perché è più versatile.
In generale, se si desidera inserire n widget in una riga, impostare rows: 1
. Se vuoi inserire n widget in una colonna, imposta cols: 1
.
Quindi, manipolare size_hint
per impostare la dimensione corretta di un widget.
È possibile utilizzare etichette vuote per creare spazi tra i widget.
Informazioni su Kivy Designer: è preferibile innanzitutto impostare manualmente l'interfaccia utente prima di utilizzare questo strumento.
#:kivy 1.9.0
<[email protected]>:
text: 'gauge'
<[email protected]>:
cols: 1
size_hint_x: .2
RoundGauge:
size_hint_y: .5
RoundGauge:
size_hint_y: .5
GridLayout:
rows: 1
Slider:
orientation: 'vertical'
Slider:
orientation: 'vertical'
# main layout divided into bottom gauges and screen part
GridLayout:
cols: 1
canvas:
Color:
rgba: 1,1,1,.5
Rectangle:
size: self.size
# both side panels and screen part
GridLayout:
rows: 1
# left panel
SidePanel:
# middle panel
GridLayout:
cols: 1
# upper gauges
GridLayout:
rows: 1
size_hint_y: .3
Label:
RoundGauge:
size_hint_x: .5
Label:
size_hint_x: .1
RoundGauge:
size_hint_x: .5
Label:
Label:
text: 'screen'
canvas:
Color:
rgba: 1,1,1,.5
Rectangle:
size: self.size
pos: self.pos
# bottom gauges
GridLayout:
rows: 1
size_hint_y: .3
RoundGauge:
RoundGauge:
RoundGauge:
RoundGauge:
RoundGauge:
RoundGauge:
# right panel
SidePanel:
GridLayout:
rows: 1
size_hint_y: .2
RoundGauge:
RoundGauge:
RoundGauge:
RoundGauge:
RoundGauge:
RoundGauge:
RoundGauge: