Kivy_Text_INPUT_Multiline_app(frames)

问题描述:

我正在开发一些应用程序在基维中,我需要在文本输入中显示多行字符串。怎么做?Kivy_Text_INPUT_Multiline_app(frames)

如果有任何示例,请张贴它。

一个例子是here连同说明。您没有提供任何代码或基本上什么我可以使用,所以我会做这种方式:

<Box>: 
    TextInput: 
     id: mytextinput 
     multiline: True ## defaults to True, but so you could see how it works 
     text: 'something' 
    Button: 
     on_release: root.update_text('new value') 

这将是你KV文件/ String在textInput无论身在何处,你就会把它和id是如何访问控件识别器,然后在蟒蛇

class Box(BoxLayout): 
    def update_text(self, value): 
     self.ids.mytextinput.text = value 

这意味着你拥有的任何部件和TextInput是其在KV文件/串儿,你要访问它通过ids字典,并改变其可变text在您的班级中拨打自定义update_text(<string>)以达到您想要的价值。