gpt4 book ai didi

python - 水平滚动 Kivy 标签

转载 作者:太空宇宙 更新时间:2023-11-03 11:26:47 24 4
gpt4 key购买 nike

我希望在 kivy 应用程序中有一个标签以固定的垂直尺寸水平滚动,而不是垂直滚动。想象一下在过去糟糕的日子里,像字幕标签这样的东西。

最终我想让它自动从左向右(和向后)滚动以显示太长而无法显示的字符串。

我见过的所有可滚动标签示例都是垂直滚动的,两天的工作让我一无所获。

编辑:注意:我暂时在 Windows 上工作。目标最终会是android和iphone

这是我想要的 UI 示例...

Example:

底部的轨道名称应为一行文本的高度并水平滚动。

最佳答案

垂直滚动的相同方式:

ScrollView:
Label:
text: 'hellooooooooooooooooooooosdsadas'
text_size: None, self.height # Set the text wrap box height
size_hint_x: None
width: self.texture_size[0] # Set the Label width to the text width

结果将是:

scroll horizontal

关于python - 水平滚动 Kivy 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32101968/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com