【发布时间】:2022-01-17 20:37:56
【问题描述】:
您好,我的代码有问题:正如您在标题中看到的那样,我有这个按钮,它应该将用户重定向到另一个页面,但是当点击它时它没有任何作用。你能帮帮我吗?
这里是代码
我在这里定义按钮
<Home>:
name: "home"
BoxLayout:
orientation: "vertical"
pos_hint: {"center_x": .5}
size_hint: .7, 1
Label:
text: "Home"
font_size: 50
Label:
text: ""
Button:
text: "FAQ"
on_release:
app.root.current: "FAQ_AP"
root.manager.transition.direction = "left"
Label:
text: ""
Button:
text: "Gestionale"
on_release:
Label:
text: ""
在这里我创建了按钮应该重定向的页面:
<FAQ_AP>:
name: "FAQ_AP"
BoxLayout:
orientation: "vertical"
pos_hint: {"center_x": .5}
size_hint: .7, 1
Label:
font_size: 50
text: "Sei un'azienda o un privato?"
Label:
text: ""
Label:
text: ""
Button:
text: "Azenda"
on_release:
Label:
text: ""
Button:
text: "Privato"
on_release:
Label:
text: ""
如果你能帮助我,那将是最好的。提前谢谢你。
【问题讨论】:
-
尝试将
app.root.current: "FAQ_AP"更改为app.root.current = "FAQ_AP"。 -
前段时间我已经想通了,但无论如何感谢您的帮助。
标签: python python-3.x kivy kivy-language