基维语:
from kivy.app import App
from kivy.uix.label import Label
class TestApp(App):
def build(self):
label = Label(text="TEST")
return label
TestApp().run()
我的标签在窗户中央:
如何将标签锚定在窗口的右下角?在
你会认为
^{pr2}$会成功的,但是正如^{
The
valign
property will have no effect andhalign
will only have an effect if your text has newlines; a single line of text will appear to be centered even thoughhalign
is set to left (by default).
这看起来就像是将标签添加到AnchorLayout中,然后缩小标签相对于其父窗口小部件的大小,共同实现了我想要的效果。在
产生:
将标签的文本大小设置为其大小,例如以kv
text_size: self.size
为单位。文本大小控制文本在其中换行的边界框。在相关问题 更多 >
编程相关推荐