【发布时间】:2018-04-19 12:18:12
【问题描述】:
您好,我在 Kivy 中定位标签时遇到问题。 我认为图片最能描述我的问题。
我想将标签 3 绑定到右边框。我不知道该怎么做。 我的代码:
import kivy
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
root = Builder.load_string('''
Screen:
BoxLayout:
orientation:'vertical'
Label:
text: '1'
font_size: self.height
size_hint: (1.0, 0.17)
Label:
text: '2'
font_size: self.height
size_hint: (1.0, 0.83)
Label:
text: '3'
''')
class MyApp(App):
def build(self):
root.size_hint = (1.0, 1.0)
return root
if __name__ == '__main__':
MyApp().run()
【问题讨论】:
标签: python layout raspberry-pi kivy kivy-language