1
我试图在我的KV语言上使用规则来生成类,但是我总是得到一个错误。Kivy,KV语言的动态类
<SimpleInputLayout>:
orientation: 'vertical'
message_label: message
user_input: input
Label:
id: message
text: root.message_to_user
FloatInput: if input_type == 'float' else TextInput:
id: input
focus: True
我能做些什么,使这个作品,如果input_type
等于'float'
我希望我的input
类是FloatInput
,否则一个TextInput
。