Kivy:.kv文件中的bind方法 [英] Kivy: bind method inside the .kv file

查看:100
本文介绍了Kivy:.kv文件中的bind方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的.py文件中删除此行:

I would like to delete this line from my .py file:

self.layout.bind(minimum_height=self.layout.setter('height'))

,并用相同的指令替换它,但在.kv文件中.有什么办法可以将self.layout.setter('height')绑定到minimum_height吗?

and replace it by the same instruction but in the .kv file. Is there any way to bind self.layout.setter('height') to minimum_height ?

推荐答案

怎么样?

height: self.minimum_height

我猜您在ScrollView中使用了它.如果为true,这应该起作用. 例如,请参见 https://stackoverflow.com/a/45313388/6646710 上的帖子.

I am guessing you use that in a ScrollView. If true this should work. See for example this post https://stackoverflow.com/a/45313388/6646710 which uses exactly that.

这篇关于Kivy:.kv文件中的bind方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆