从输入中计算多个结果并在标签 KIVY 中替换

Posted

技术标签:

【中文标题】从输入中计算多个结果并在标签 KIVY 中替换【英文标题】:Calculate multiple result from inputs and replace in label KIVY 【发布时间】:2018-10-31 01:37:56 【问题描述】:

问题已解决。关闭主题

【问题讨论】:

【参考方案1】:

来自 kivy documentation:

文字

标签的文本。

创建一个简单的hello world:

widget = Label(text='Hello world')

如果要使用 unicode 字符串创建小部件,请使用:

widget = Label(text=u'My unicode string')

text 是一个StringProperty,默认为''。

如果要更改特定标签的文本,只需使用其 id 检索,然后设置所需的文本:

self.ids.id_of_label_you_want_to_change.text = "Text you want to set"

【讨论】:

我找到其他方法来解决 ` Button : text: 'Mohasebe' on_press : root.product(*args) ` ` class root(BoxLayout): # -- For define def product(self, instance ): 通过`

以上是关于从输入中计算多个结果并在标签 KIVY 中替换的主要内容,如果未能解决你的问题,请参考以下文章