繁体   English   中英

如何在 kivyMD 中创建多行文本

[英]How do I create multiline texts in kivyMD

我正在尝试使用多行文本创建一个简单的应用程序,但我不断收到“无效的缩进(级别太多)”。 这是我的 main.py 文件;

from kivymd.app import MDApp


class TwoScreenApp(MDApp):
    def build(self):
        return


TwoScreenApp().run()

这是我的 .kv 文件。 我将不胜感激任何形式的帮助,谢谢。

MDScreen:
    md_bg_color: (255/255, 255/255, 255/255, 1)

MDLabel:
    halign: 'center'
    text: """With the production of the Model T automobile,
            \nHenry Ford had an unforeseen and tremendous
            \nimpact on American life. He became regarded
            \nas an apt symbol of the transition from an
            \nagricultural to an industrial America.
        """

这将起作用:

MDLabel:
    halign: 'center'
    text:
        """With the production of the Model T automobile,
        Henry Ford had an unforeseen and tremendous
        impact on American life. He became regarded
        as an apt symbol of the transition from an
        agricultural to an industrial America."""

出于某种原因,将多行文字放在单独的行上可以使其工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM